@openclaw/matrix 2026.9.6 → 2026.9.8
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/assets/icon.png +0 -0
- package/dist/.setup/account-selection-B7axQ80R.mjs +196 -0
- package/dist/.setup/accounts-WkgrIxMt.mjs +138 -0
- package/dist/.setup/approval-handler.runtime-C-pw3NvY.mjs +408 -0
- package/dist/.setup/approval-reactions-BrS5ECU0.mjs +196 -0
- package/dist/.setup/channel-DXenXmj0.mjs +1198 -0
- package/dist/.setup/channel.runtime-BXUawOno.mjs +71 -0
- package/dist/.setup/channel.setup-DWfLaXqT.mjs +372 -0
- package/dist/.setup/cli-IhZO2OEj.mjs +1300 -0
- package/dist/.setup/cli-metadata-nowEgdY0.mjs +22 -0
- package/dist/.setup/client-BXATebyo.mjs +27 -0
- package/dist/.setup/client-Ccv77kwh.mjs +916 -0
- package/dist/.setup/client-bootstrap-BiHX55is.mjs +75 -0
- package/dist/.setup/config-update-5m1Un5gJ.mjs +145 -0
- package/dist/.setup/create-client-DRZ580E3.mjs +64 -0
- package/dist/.setup/credentials-C9qDO5-2.mjs +74 -0
- package/dist/.setup/credentials-read-KD4o5biZ.mjs +77 -0
- package/dist/.setup/crypto-runtime-DPjIDF8H.mjs +1077 -0
- package/dist/.setup/crypto-snapshot-doctor.runtime-44FrCPR7.mjs +91 -0
- package/dist/.setup/deps-CLQ4EOq7.mjs +162 -0
- package/dist/.setup/device-health-U-yoVjPw.mjs +21 -0
- package/dist/.setup/direct-management-Cn2t8n1V.mjs +300 -0
- package/dist/.setup/directory-live-_sw-Q7KO.mjs +118 -0
- package/dist/.setup/doctor-DMvEBx6o.mjs +49 -0
- package/dist/.setup/doctor-contract-De6geW0h.mjs +350 -0
- package/dist/.setup/draft-stream-CdVMstpR.mjs +157 -0
- package/dist/.setup/encryption-guidance-B6797jNA.mjs +16 -0
- package/dist/.setup/exec-approvals-fsiMQ1ce.mjs +186 -0
- package/dist/.setup/file-sync-store-B-9bMb_O.mjs +187 -0
- package/dist/.setup/http-client-C1XvVD3K.mjs +362 -0
- package/dist/.setup/idb-persistence-DBvfre1X.mjs +227 -0
- package/dist/.setup/idb-persistence-lock-D_mDu4Cf.mjs +27 -0
- package/dist/.setup/inbound-dedupe-BGrMrTTu.mjs +48 -0
- package/dist/.setup/joined-room-encryption-TZoOKXgh.mjs +67 -0
- package/dist/.setup/logger-CVv56jzH.mjs +74 -0
- package/dist/.setup/logging-mhnFQGzB.mjs +96 -0
- package/dist/.setup/messages-Buz27pi5.mjs +324 -0
- package/dist/.setup/monitor-BBg5qgov.mjs +4352 -0
- package/dist/.setup/onboarding-hJaieQj5.mjs +482 -0
- package/dist/.setup/outbound-C9vBijaH.mjs +199 -0
- package/dist/.setup/profile-B3DD2jYa.mjs +100 -0
- package/dist/.setup/profile-update-CmxIAd4c.mjs +66 -0
- package/dist/.setup/reaction-events-mnzc_JvP.mjs +168 -0
- package/dist/.setup/resolve-targets-BFq3q4c9.mjs +87 -0
- package/dist/.setup/room-info-BbTGRJcR.mjs +134 -0
- package/dist/.setup/sdk-DmRVM0VA.mjs +1907 -0
- package/dist/.setup/send-GOF64QRc.mjs +2117 -0
- package/dist/.setup/send-currentness-C2rMVVIQ.mjs +87 -0
- package/dist/.setup/setup-bootstrap-AzalcuCW.mjs +62 -0
- package/dist/.setup/setup-core-BeifoeL4.mjs +377 -0
- package/dist/.setup/setup-plugin-api-Bsbdw41x.mjs +3 -0
- package/dist/.setup/startup-verification-Aiy_xVdI.mjs +204 -0
- package/dist/.setup/storage-BXS2cB2i.mjs +288 -0
- package/dist/.setup/storage-metadata-BDRZ7vpX.mjs +371 -0
- package/dist/.setup/storage-paths-B51JM-pC.mjs +53 -0
- package/dist/.setup/subagent-hooks-D5kd_kzN.mjs +52 -0
- package/dist/.setup/sync-cache-state-C6sEmvJK.mjs +192 -0
- package/dist/.setup/thread-bindings-jXu_9cHE.mjs +443 -0
- package/dist/.setup/thread-bindings-shared-hxKkYC1W.mjs +89 -0
- package/dist/.setup/tool-actions-Ce7Okg6m.mjs +746 -0
- package/dist/.setup/url-validation-CF6pG6eE.mjs +36 -0
- package/dist/.setup/verification-C45rOZkM.mjs +329 -0
- package/dist/api.js +7 -7
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +142 -288
- package/dist/helper-api.js +2 -2
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +17 -9
- package/dist/runtime-api.js +4 -4
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +1289 -0
- package/node_modules/@openclaw/fs-safe/LICENSE +22 -0
- package/node_modules/@openclaw/fs-safe/README.md +672 -0
- package/node_modules/@openclaw/fs-safe/SECURITY.md +45 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +323 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.js +19 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.js +101 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.js +85 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.js +23 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.js +99 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.js +98 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts +56 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.js +131 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +282 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +85 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.js +119 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +234 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +308 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.js +127 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.js +203 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.js +96 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +267 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +10 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.js +150 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.js +24 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.js +149 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.js +332 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.js +17 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.js +143 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-view.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-view.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/clone-metadata.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/clone-metadata.js +36 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/config.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-policy.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-policy.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-publication.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +245 -0
- package/node_modules/@openclaw/fs-safe/dist/copy.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/copy.js +143 -0
- package/node_modules/@openclaw/fs-safe/dist/create-owned-file.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/create-owned-file.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/create.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/create.js +388 -0
- package/node_modules/@openclaw/fs-safe/dist/creation-boundary.d.ts +60 -0
- package/node_modules/@openclaw/fs-safe/dist/creation-boundary.js +371 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +96 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.js +139 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.js +286 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +54 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +176 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +285 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-receipt.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-receipt.js +121 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/effective-uid.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/effective-uid.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/file-contents.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/file-contents.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.js +190 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.js +296 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.js +56 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.js +98 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +58 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +303 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +66 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.js +392 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +209 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +275 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.js +58 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.js +90 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +288 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +199 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +341 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.js +66 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +174 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +110 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +319 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +128 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +62 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +360 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.js +19 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.js +138 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +281 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +68 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +127 -0
- package/node_modules/@openclaw/fs-safe/dist/guest.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/guest.js +433 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.js +149 -0
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/index.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.js +136 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.js +105 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +154 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.js +355 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.js +65 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +44 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +210 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/json.d.ts +49 -0
- package/node_modules/@openclaw/fs-safe/dist/json.js +323 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.js +84 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts +30 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +224 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-stage.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-stage.js +56 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.js +390 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +41 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +199 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.js +37 -0
- package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.js +11 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +111 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +147 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +252 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +478 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +209 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +442 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +303 -0
- package/node_modules/@openclaw/fs-safe/dist/native.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native.js +209 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.js +46 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.js +102 -0
- package/node_modules/@openclaw/fs-safe/dist/output.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/output.js +139 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.js +46 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.js +54 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.js +64 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +39 -0
- package/node_modules/@openclaw/fs-safe/dist/path-case.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/path-case.js +136 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.js +49 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +104 -0
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.js +37 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.js +24 -0
- package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.js +394 -0
- package/node_modules/@openclaw/fs-safe/dist/path.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/path.js +185 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +194 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +48 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.js +319 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +52 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.js +131 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +421 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.d.ts +38 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.js +205 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.js +70 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +30 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +98 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +35 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.js +31 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +185 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +68 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +300 -0
- package/node_modules/@openclaw/fs-safe/dist/positional-read.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/positional-read.js +36 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.js +72 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +358 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +341 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +332 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.js +43 -0
- package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.js +317 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +275 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +36 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +369 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +101 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +46 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +168 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +123 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.js +10 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.js +47 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +49 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +368 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +356 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.js +193 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file-types.d.ts +50 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file.js +121 -0
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +186 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +233 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +93 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.js +225 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +28 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +46 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +433 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory.js +141 -0
- package/node_modules/@openclaw/fs-safe/dist/root-entries.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/root-entries.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +92 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts +46 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.js +205 -0
- package/node_modules/@openclaw/fs-safe/dist/root-handle-context.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-handle-context.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +117 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +1446 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +205 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +90 -0
- package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +84 -0
- package/node_modules/@openclaw/fs-safe/dist/root-options.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-errors.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-errors.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-observation.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +151 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +440 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +58 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +296 -0
- package/node_modules/@openclaw/fs-safe/dist/root-public-types.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-public-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-read-admission.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/root-read-admission.js +86 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.js +87 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.js +37 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.js +464 -0
- package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +48 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +234 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +65 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +299 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.js +23 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.js +162 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.js +72 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-publication.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-publication.js +85 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +95 -0
- package/node_modules/@openclaw/fs-safe/dist/root.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/root.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +80 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +333 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.js +58 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +68 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.js +79 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.js +298 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +176 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.js +110 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +301 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +28 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +132 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +442 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.js +113 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js +48 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +113 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +67 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +374 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.js +47 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.js +79 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +228 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.js +55 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts +68 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +282 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.js +148 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +57 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/stat-observation.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/stat-observation.js +57 -0
- package/node_modules/@openclaw/fs-safe/dist/store.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/store.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +88 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +109 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +88 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +236 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +387 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +150 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.d.ts +42 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +341 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +398 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.js +52 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.js +59 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.js +245 -0
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/unicode-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/unicode-path.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.js +207 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.js +88 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +93 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +36 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +73 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +28 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +300 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +32 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-types.d.ts +60 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.js +530 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +100 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +122 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.cs +336 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.ps1 +90 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-command.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-command.js +414 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.js +112 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +49 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.js +15 -0
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +271 -0
- package/node_modules/@openclaw/fs-safe/docs/archive.md +859 -0
- package/node_modules/@openclaw/fs-safe/docs/assets/readme-banner.jpg +0 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +611 -0
- package/node_modules/@openclaw/fs-safe/docs/config.md +136 -0
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +360 -0
- package/node_modules/@openclaw/fs-safe/docs/copy.md +199 -0
- package/node_modules/@openclaw/fs-safe/docs/creation.md +132 -0
- package/node_modules/@openclaw/fs-safe/docs/directory-identity.md +85 -0
- package/node_modules/@openclaw/fs-safe/docs/durability.md +445 -0
- package/node_modules/@openclaw/fs-safe/docs/entries.md +109 -0
- package/node_modules/@openclaw/fs-safe/docs/errors.md +240 -0
- package/node_modules/@openclaw/fs-safe/docs/file-contents.md +68 -0
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +369 -0
- package/node_modules/@openclaw/fs-safe/docs/filename.md +110 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +152 -0
- package/node_modules/@openclaw/fs-safe/docs/in-place-write.md +81 -0
- package/node_modules/@openclaw/fs-safe/docs/index.md +87 -0
- package/node_modules/@openclaw/fs-safe/docs/install-path.md +216 -0
- package/node_modules/@openclaw/fs-safe/docs/install.md +252 -0
- package/node_modules/@openclaw/fs-safe/docs/json-store.md +240 -0
- package/node_modules/@openclaw/fs-safe/docs/json.md +225 -0
- package/node_modules/@openclaw/fs-safe/docs/local-roots.md +150 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +205 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.6.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/mutation-policy-proof.md +69 -0
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +193 -0
- package/node_modules/@openclaw/fs-safe/docs/native.md +351 -0
- package/node_modules/@openclaw/fs-safe/docs/output.md +193 -0
- package/node_modules/@openclaw/fs-safe/docs/path-case.md +64 -0
- package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +74 -0
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +159 -0
- package/node_modules/@openclaw/fs-safe/docs/path-suffix-aliases.md +204 -0
- package/node_modules/@openclaw/fs-safe/docs/path.md +219 -0
- package/node_modules/@openclaw/fs-safe/docs/permissions.md +352 -0
- package/node_modules/@openclaw/fs-safe/docs/positional-read.md +63 -0
- package/node_modules/@openclaw/fs-safe/docs/private-file-store.md +68 -0
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +188 -0
- package/node_modules/@openclaw/fs-safe/docs/quickstart.md +154 -0
- package/node_modules/@openclaw/fs-safe/docs/reading.md +196 -0
- package/node_modules/@openclaw/fs-safe/docs/regular-file.md +193 -0
- package/node_modules/@openclaw/fs-safe/docs/retained-file.md +115 -0
- package/node_modules/@openclaw/fs-safe/docs/root.md +571 -0
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +318 -0
- package/node_modules/@openclaw/fs-safe/docs/secure-file.md +112 -0
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +272 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +599 -0
- package/node_modules/@openclaw/fs-safe/docs/staged-file.md +192 -0
- package/node_modules/@openclaw/fs-safe/docs/staged-symlink.md +124 -0
- package/node_modules/@openclaw/fs-safe/docs/store.md +129 -0
- package/node_modules/@openclaw/fs-safe/docs/temp.md +780 -0
- package/node_modules/@openclaw/fs-safe/docs/test-hooks.md +110 -0
- package/node_modules/@openclaw/fs-safe/docs/testing.md +399 -0
- package/node_modules/@openclaw/fs-safe/docs/timing.md +123 -0
- package/node_modules/@openclaw/fs-safe/docs/types.md +217 -0
- package/node_modules/@openclaw/fs-safe/docs/walk.md +283 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +251 -0
- package/node_modules/@openclaw/fs-safe/docs/writing.md +662 -0
- package/node_modules/@openclaw/fs-safe/package.json +204 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +29 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +29 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +32 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +32 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +32 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +32 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +29 -0
- package/node_modules/content-type/README.md +81 -0
- package/node_modules/content-type/dist/index.d.ts +54 -0
- package/node_modules/content-type/dist/index.js +291 -0
- package/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/content-type/package.json +61 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/file-type/package.json +275 -0
- package/node_modules/file-type/readme.md +605 -0
- package/node_modules/file-type/source/detectors/zip.js +653 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/FUNDING.yml +1 -0
- package/node_modules/jszip/.github/actions/setup/action.yml +23 -0
- package/node_modules/jszip/.github/workflows/benchmark.yml +38 -0
- package/node_modules/jszip/.github/workflows/main.yml +55 -0
- package/node_modules/jszip/CHANGES.md +210 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/dist/jszip.js +11586 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/index.d.ts +344 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +510 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/matrix-js-sdk/CHANGELOG.md +20 -0
- package/node_modules/matrix-js-sdk/lib/@types/json.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/json.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/client.d.ts +74 -5
- package/node_modules/matrix-js-sdk/lib/client.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/client.js +83 -7
- package/node_modules/matrix-js-sdk/lib/client.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.d.ts +42 -23
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js +7 -0
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/embedded.d.ts +35 -1
- package/node_modules/matrix-js-sdk/lib/embedded.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/embedded.js +49 -1
- package/node_modules/matrix-js-sdk/lib/embedded.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.d.ts +0 -1
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.js +3 -22
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/logging.d.ts +10 -0
- package/node_modules/matrix-js-sdk/lib/http-api/logging.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/http-api/logging.js +46 -0
- package/node_modules/matrix-js-sdk/lib/http-api/logging.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts +5 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +82 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +25 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts +41 -2
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +59 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +7 -4
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts +17 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +68 -29
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.d.ts +9 -3
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.js +51 -11
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oauth/authorize.d.ts +7 -2
- package/node_modules/matrix-js-sdk/lib/oauth/authorize.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oauth/authorize.js +10 -4
- package/node_modules/matrix-js-sdk/lib/oauth/authorize.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oauth/fetch.d.ts +17 -0
- package/node_modules/matrix-js-sdk/lib/oauth/fetch.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/oauth/fetch.js +47 -0
- package/node_modules/matrix-js-sdk/lib/oauth/fetch.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/oauth/index.d.ts +15 -2
- package/node_modules/matrix-js-sdk/lib/oauth/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oauth/index.js +33 -12
- package/node_modules/matrix-js-sdk/lib/oauth/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.d.ts +17 -0
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +4 -2
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts +6 -26
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +19 -54
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js +65 -27
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync.d.ts +17 -0
- package/node_modules/matrix-js-sdk/lib/sliding-sync.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync.js +21 -9
- package/node_modules/matrix-js-sdk/lib/sliding-sync.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync.d.ts +9 -1
- package/node_modules/matrix-js-sdk/lib/sync.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync.js +54 -29
- package/node_modules/matrix-js-sdk/lib/sync.js.map +1 -1
- package/node_modules/matrix-js-sdk/package.json +5 -5
- package/node_modules/matrix-js-sdk/src/@types/json.ts +11 -2
- package/node_modules/matrix-js-sdk/src/client.ts +126 -11
- package/node_modules/matrix-js-sdk/src/common-crypto/CryptoBackend.ts +45 -23
- package/node_modules/matrix-js-sdk/src/embedded.ts +67 -4
- package/node_modules/matrix-js-sdk/src/http-api/fetch.ts +2 -23
- package/node_modules/matrix-js-sdk/src/http-api/logging.ts +46 -0
- package/node_modules/matrix-js-sdk/src/matrixrtc/EncryptionManager.ts +6 -0
- package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +86 -0
- package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +81 -1
- package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +7 -7
- package/node_modules/matrix-js-sdk/src/matrixrtc/RTCEncryptionManager.ts +80 -31
- package/node_modules/matrix-js-sdk/src/models/room-receipts.ts +54 -10
- package/node_modules/matrix-js-sdk/src/oauth/authorize.ts +10 -2
- package/node_modules/matrix-js-sdk/src/oauth/fetch.ts +54 -0
- package/node_modules/matrix-js-sdk/src/oauth/index.ts +29 -10
- package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +23 -0
- package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +25 -67
- package/node_modules/matrix-js-sdk/src/sliding-sync-sdk.ts +73 -33
- package/node_modules/matrix-js-sdk/src/sliding-sync.ts +31 -14
- package/node_modules/matrix-js-sdk/src/sync.ts +58 -35
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/strtok3/lib/types.js +1 -0
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/unicode/unicode_segment.mjs +165 -0
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/openclaw.plugin.json +24 -0
- package/package.json +8 -6
- package/dist/.setup/account-selection-BHkfU1eC.mjs +0 -212
- package/dist/.setup/accounts-iThMol10.mjs +0 -130
- package/dist/.setup/approval-handler.runtime-9W7R2ZMq.mjs +0 -415
- package/dist/.setup/approval-ids-j08q8LEG.mjs +0 -7
- package/dist/.setup/approval-reaction-auth-DMVE7VSp.mjs +0 -31
- package/dist/.setup/approval-reactions-B0hfA6qz.mjs +0 -196
- package/dist/.setup/channel-ConuJfxT.mjs +0 -1427
- package/dist/.setup/channel.runtime-CnxR2JUK.mjs +0 -71
- package/dist/.setup/channel.setup-C6KvBV8l.mjs +0 -357
- package/dist/.setup/cli-O196sg8g.mjs +0 -1410
- package/dist/.setup/cli-metadata-DFHQj5XR.mjs +0 -22
- package/dist/.setup/client-C2yVkVdw.mjs +0 -27
- package/dist/.setup/client-ChrXpxos.mjs +0 -922
- package/dist/.setup/client-bootstrap-BSnUAoz1.mjs +0 -78
- package/dist/.setup/config-secret-input.runtime-CwsP3--c.mjs +0 -2
- package/dist/.setup/config-update-B_4qZ5bV.mjs +0 -167
- package/dist/.setup/create-client-CHxcron_.mjs +0 -67
- package/dist/.setup/credentials-BGKfiaJW.mjs +0 -85
- package/dist/.setup/credentials-read-Q5sHkkHv.mjs +0 -74
- package/dist/.setup/credentials-write.runtime-DxbXh-pK.mjs +0 -14
- package/dist/.setup/crypto-runtime-D9qn_Pbj.mjs +0 -1138
- package/dist/.setup/crypto-snapshot-doctor.runtime-CMWa1d9Y.mjs +0 -91
- package/dist/.setup/deps-mtxF2mHI.mjs +0 -169
- package/dist/.setup/device-health-CWOuIirq.mjs +0 -21
- package/dist/.setup/direct-management-B2Bno2xL.mjs +0 -346
- package/dist/.setup/directory-live-CxqkcYbT.mjs +0 -153
- package/dist/.setup/doctor-BLCvdOFo.mjs +0 -64
- package/dist/.setup/doctor-contract-HyWFZQVG.mjs +0 -167
- package/dist/.setup/draft-stream-y0Vq5f38.mjs +0 -175
- package/dist/.setup/encryption-guidance-CMWXiBzJ.mjs +0 -16
- package/dist/.setup/file-sync-store-CsalA4yI.mjs +0 -213
- package/dist/.setup/http-client-Bi6uKmzh.mjs +0 -410
- package/dist/.setup/idb-persistence-c8uxcofH.mjs +0 -237
- package/dist/.setup/idb-persistence-lock-B3fZXyF_.mjs +0 -32
- package/dist/.setup/inbound-dedupe-BSlv35xl.mjs +0 -48
- package/dist/.setup/joined-room-encryption-BCtxQ3hR.mjs +0 -67
- package/dist/.setup/logger-xBjiRIp1.mjs +0 -78
- package/dist/.setup/logging-rgm8ep9H.mjs +0 -99
- package/dist/.setup/messages-COuAcrz-.mjs +0 -324
- package/dist/.setup/monitor-CzE3myC_.mjs +0 -4544
- package/dist/.setup/outbound-B508VPBM.mjs +0 -228
- package/dist/.setup/probe.runtime-C-NMeYk2.mjs +0 -2
- package/dist/.setup/profile-ClrB3IgR.mjs +0 -108
- package/dist/.setup/profile-update-DrblJttE.mjs +0 -70
- package/dist/.setup/reaction-events-BvZmhjLC.mjs +0 -168
- package/dist/.setup/resolve-targets-BLz748lX.mjs +0 -140
- package/dist/.setup/resolver.runtime-CuLQ2uHe.mjs +0 -5
- package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
- package/dist/.setup/room-info-DTyP1k5g.mjs +0 -153
- package/dist/.setup/sdk-rqFjgltR.mjs +0 -1949
- package/dist/.setup/send-aVdC5NJO.mjs +0 -2216
- package/dist/.setup/send-currentness-BrGXL7b8.mjs +0 -90
- package/dist/.setup/setup-bootstrap-A_WGFq1Y.mjs +0 -62
- package/dist/.setup/setup-core-D2hMbIi3.mjs +0 -386
- package/dist/.setup/setup-plugin-api-JiRgm8s6.mjs +0 -3
- package/dist/.setup/setup-surface-BL3ha1l-.mjs +0 -482
- package/dist/.setup/startup-verification-Cp1Gf7pM.mjs +0 -233
- package/dist/.setup/storage-BXaFc0S4.mjs +0 -324
- package/dist/.setup/storage-metadata-fHN6Df2m.mjs +0 -372
- package/dist/.setup/storage-paths-DVCANXTc.mjs +0 -53
- package/dist/.setup/subagent-hooks-jFgft_Mr.mjs +0 -52
- package/dist/.setup/sync-cache-state-BMtGMxU1.mjs +0 -227
- package/dist/.setup/thread-bindings-JlnLDfPM.mjs +0 -444
- package/dist/.setup/thread-bindings-shared-oNPiyMWY.mjs +0 -92
- package/dist/.setup/tool-actions.runtime-REzYTNxm.mjs +0 -862
- package/dist/.setup/url-validation-GRHde6lq.mjs +0 -36
- package/dist/.setup/verification-0o8MOW9T.mjs +0 -346
- package/node_modules/matrix-js-sdk/node_modules/content-type/README.md +0 -71
- package/node_modules/matrix-js-sdk/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/matrix-js-sdk/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/matrix-js-sdk/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/matrix-js-sdk/node_modules/content-type/package.json +0 -52
- package/node_modules/music-metadata/node_modules/debug/LICENSE +0 -20
- package/node_modules/music-metadata/node_modules/debug/README.md +0 -481
- package/node_modules/music-metadata/node_modules/debug/package.json +0 -64
- package/node_modules/music-metadata/node_modules/debug/src/browser.js +0 -272
- package/node_modules/music-metadata/node_modules/debug/src/common.js +0 -292
- package/node_modules/music-metadata/node_modules/debug/src/index.js +0 -10
- package/node_modules/music-metadata/node_modules/debug/src/node.js +0 -263
- package/node_modules/music-metadata/node_modules/file-type/package.json +0 -275
- package/node_modules/music-metadata/node_modules/file-type/readme.md +0 -603
- package/node_modules/music-metadata/node_modules/file-type/source/detectors/zip.js +0 -648
- package/node_modules/music-metadata/node_modules/ms/index.js +0 -162
- package/node_modules/music-metadata/node_modules/ms/license.md +0 -21
- package/node_modules/music-metadata/node_modules/ms/package.json +0 -38
- package/node_modules/music-metadata/node_modules/ms/readme.md +0 -59
- package/node_modules/typebox/build/guard/string.mjs +0 -168
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/OverloadYield.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/applyDecoratedDescriptor.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/applyDecs2311.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/arrayLikeToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/arrayWithHoles.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/arrayWithoutHoles.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/assertClassBrand.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/assertThisInitialized.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/asyncGeneratorDelegate.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/asyncIterator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/asyncToGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/awaitAsyncGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/callSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/checkInRHS.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/checkPrivateRedeclaration.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classCallCheck.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classNameTDZError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateFieldGet2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateFieldInitSpec.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateFieldLooseBase.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateFieldLooseKey.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateFieldSet2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateGetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateMethodInitSpec.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classPrivateSetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/classStaticPrivateMethodGet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/construct.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/createClass.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/createForOfIteratorHelper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/createForOfIteratorHelperLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/createSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/defaults.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/defineAccessor.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/defineProperty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/OverloadYield.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/applyDecoratedDescriptor.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/applyDecs2311.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/arrayLikeToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/arrayWithHoles.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/arrayWithoutHoles.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/assertClassBrand.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/assertThisInitialized.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/asyncGeneratorDelegate.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/asyncIterator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/asyncToGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/awaitAsyncGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/callSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/checkInRHS.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/checkPrivateRedeclaration.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classCallCheck.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classNameTDZError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateFieldGet2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateFieldInitSpec.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateFieldLooseBase.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateFieldLooseKey.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateFieldSet2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateGetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateMethodInitSpec.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classPrivateSetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/classStaticPrivateMethodGet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/construct.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/createClass.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/createForOfIteratorHelper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/createForOfIteratorHelperLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/createSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/defaults.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/defineAccessor.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/defineProperty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/extends.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/get.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/getPrototypeOf.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/identity.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/importDeferProxy.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/inherits.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/inheritsLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/initializerDefineProperty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/initializerWarningHelper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/instanceof.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/interopRequireDefault.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/interopRequireWildcard.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/isNativeFunction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/isNativeReflectConstruct.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/iterableToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/iterableToArrayLimit.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/jsx.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/maybeArrayLike.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/newArrowCheck.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/nonIterableRest.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/nonIterableSpread.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/nullishReceiverError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/objectDestructuringEmpty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/objectSpread2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/objectWithoutProperties.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/possibleConstructorReturn.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/readOnlyError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorAsync.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorAsyncGen.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorAsyncIterator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorDefine.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorKeys.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/regeneratorValues.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/set.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/setFunctionName.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/setPrototypeOf.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/skipFirstGeneratorNext.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/slicedToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/superPropBase.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/superPropGet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/superPropSet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/taggedTemplateLiteral.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/taggedTemplateLiteralLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/tdz.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/temporalRef.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/temporalUndefined.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/toArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/toConsumableArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/toPrimitive.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/toPropertyKey.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/toSetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/tsRewriteRelativeImportExtensions.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/typeof.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/unsupportedIterableToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/usingCtx.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/wrapAsyncGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/wrapNativeSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/wrapRegExp.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/esm/writeOnlyError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/extends.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/get.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/getPrototypeOf.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/identity.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/importDeferProxy.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/inherits.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/inheritsLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/initializerDefineProperty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/initializerWarningHelper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/instanceof.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/interopRequireDefault.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/interopRequireWildcard.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/isNativeFunction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/isNativeReflectConstruct.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/iterableToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/iterableToArrayLimit.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/jsx.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/maybeArrayLike.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/newArrowCheck.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/nonIterableRest.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/nonIterableSpread.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/nullishReceiverError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/objectDestructuringEmpty.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/objectSpread2.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/objectWithoutProperties.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/objectWithoutPropertiesLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/possibleConstructorReturn.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/readOnlyError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorAsync.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorAsyncGen.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorAsyncIterator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorDefine.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorKeys.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/regeneratorValues.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/set.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/setFunctionName.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/setPrototypeOf.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/skipFirstGeneratorNext.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/slicedToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/superPropBase.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/superPropGet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/superPropSet.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/taggedTemplateLiteral.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/taggedTemplateLiteralLoose.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/tdz.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/temporalRef.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/temporalUndefined.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/toArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/toConsumableArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/toPrimitive.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/toPropertyKey.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/toSetter.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/tsRewriteRelativeImportExtensions.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/typeof.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/unsupportedIterableToArray.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/usingCtx.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/wrapAsyncGenerator.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/wrapNativeSuper.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/wrapRegExp.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/helpers/writeOnlyError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@babel → @babel}/runtime/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/@borewit → @borewit}/text-codec/LICENSE.txt +0 -0
- /package/node_modules/{music-metadata/node_modules/@borewit → @borewit}/text-codec/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/@borewit → @borewit}/text-codec/lib/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@borewit → @borewit}/text-codec/lib/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/@borewit → @borewit}/text-codec/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3/lib/types.js → @openclaw/fs-safe/dist/containment.js} +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/LICENSE +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/GzipHandler.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/GzipHandler.js +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/ZipHandler.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/ZipHandler.js +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/ZipToken.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/ZipToken.js +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/lib/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/inflate/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/token/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/token/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/@tokenizer → @tokenizer}/token/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@types → @types}/events/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@types → @types}/events/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@types → @types}/events/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/@types → @types}/events/package.json +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/LICENSE +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/README.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/helpers.d.ts +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/helpers.d.ts.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/helpers.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/helpers.js.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/index.d.ts +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/index.d.ts.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/index.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/dist/index.js.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/agent-base → agent-base}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/.jshint +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/.npmignore +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/.travis.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/another-json.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/another-json → another-json}/spec/another-json-spec.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/LICENSE +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/README.md +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/_colorize.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/argparse.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/argparse.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/difflib.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/sub.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/lib/textwrap.js +0 -0
- /package/node_modules/{markdown-it/node_modules/argparse → argparse}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/LICENSE.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/src/cjs/index.cjs +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/src/cjs/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/base-x → base-x}/src/esm/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/src/cjs/index.cjs +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/src/cjs/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/bs58 → bs58}/src/esm/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/content-type → content-type}/LICENSE +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/LICENSE +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/README.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/package.json +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/src/browser.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/src/common.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/src/index.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/debug → debug}/src/node.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/LICENSE +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode-codepoint.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode-codepoint.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode-codepoint.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode-codepoint.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/decode.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/encode.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/encode.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/encode.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/encode.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/escape.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/escape.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/escape.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/escape.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-html.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-html.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-html.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-html.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-xml.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-xml.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-xml.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/decode-data-xml.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/encode-html.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/encode-html.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/encode-html.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/generated/encode-html.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/index.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/index.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/index.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/index.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/bin-trie-flags.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/bin-trie-flags.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/bin-trie-flags.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/bin-trie-flags.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/decode-shared.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/decode-shared.d.ts.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/decode-shared.js +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/dist/internal/decode-shared.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/package.json +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/readme.md +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/decode-codepoint.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/decode.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/encode.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/escape.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/generated/decode-data-html.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/generated/decode-data-xml.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/generated/encode-html.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/index.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/internal/bin-trie-flags.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/entities → entities}/src/internal/decode-shared.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/.airtap.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/.github/FUNDING.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/.travis.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/History.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/Readme.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/events.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/security.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/add-listeners.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/check-listener-leaks.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/common.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/errors.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/events-list.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/events-once.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/legacy-compat.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/listener-count.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/listeners-side-effects.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/listeners.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/max-listeners.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/method-names.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/modify-in-emit.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/num-args.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/once.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/prepend.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/remove-all-listeners.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/remove-listeners.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/set-max-listeners-side-effects.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/special-event-names.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/subclass.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/events → events}/tests/symbols.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/is-network-error → file-type}/license +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/detectors/asf.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/detectors/ebml.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/detectors/png.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/index.test-d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/parser.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/supported.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → file-type}/source/tokens.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/LICENSE +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/README.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.d.ts +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.d.ts.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.js.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.d.ts +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.d.ts.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.js.map +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/https-proxy-agent → https-proxy-agent}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/ieee754 → ieee754}/LICENSE +0 -0
- /package/node_modules/{music-metadata/node_modules/ieee754 → ieee754}/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/ieee754 → ieee754}/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/ieee754 → ieee754}/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/ieee754 → ieee754}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/is-network-error → is-network-error}/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/is-network-error → is-network-error}/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/p-retry → is-network-error}/license +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/is-network-error → is-network-error}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/is-network-error → is-network-error}/readme.md +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/LICENSE +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/README.md +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/build/index.cjs.js +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/build/index.cjs.js.map +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/build/index.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/build/index.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/build/index.mjs.map +0 -0
- /package/node_modules/{markdown-it/node_modules/linkify-it → linkify-it}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/.editorconfig +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/CONTRIBUTING.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/Gruntfile.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/LICENSE-MIT +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/_config.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/bower.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/demo/index.html +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/demo/script.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/demo/styles.css +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/dist/loglevel.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/dist/loglevel.min.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/lib/loglevel.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/loglevel → loglevel}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/ExtensibleEvents.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/ExtensibleEvents.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/IPartialEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/IPartialEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/InvalidEventError.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/InvalidEventError.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/NamespacedMap.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/NamespacedMap.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/NamespacedValue.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/NamespacedValue.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/EmoteEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/EmoteEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/ExtensibleEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/ExtensibleEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/MessageEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/MessageEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/NoticeEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/NoticeEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollEndEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollEndEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollResponseEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollResponseEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollStartEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/PollStartEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/message_types.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/message_types.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/poll_types.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/poll_types.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/relationship_types.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/events/relationship_types.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/legacy/MRoomMessage.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/legacy/MRoomMessage.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/modern/MMessage.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/modern/MMessage.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/modern/MPoll.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/interpreters/modern/MPoll.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/types.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/types.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/utility/MessageMatchers.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/utility/MessageMatchers.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/utility/events.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/lib/utility/events.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-events-sdk → matrix-events-sdk}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/dist/api.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/dist/api.min.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/ClientWidgetApi.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/ClientWidgetApi.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/ClientWidgetApi.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/Symbols.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/Symbols.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/Symbols.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/WidgetApi.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/WidgetApi.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/WidgetApi.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/driver/WidgetDriver.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/driver/WidgetDriver.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/driver/WidgetDriver.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/index.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ApiVersion.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ApiVersion.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ApiVersion.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/Capabilities.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/Capabilities.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/Capabilities.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/CapabilitiesAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/CapabilitiesAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/CapabilitiesAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ContentLoadedAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ContentLoadedAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ContentLoadedAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/DownloadFileAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/DownloadFileAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/DownloadFileAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetMediaConfigAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetMediaConfigAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetMediaConfigAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetOpenIDAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetOpenIDAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/GetOpenIDAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ICustomWidgetData.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ICustomWidgetData.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ICustomWidgetData.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IJitsiWidgetData.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IJitsiWidgetData.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IJitsiWidgetData.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomAccountData.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomAccountData.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomAccountData.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomEvent.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomEvent.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IRoomEvent.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IStickerpickerWidgetData.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IStickerpickerWidgetData.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IStickerpickerWidgetData.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IToDeviceMessage.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IToDeviceMessage.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IToDeviceMessage.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidget.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidget.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidget.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiErrorResponse.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiErrorResponse.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiErrorResponse.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiRequest.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiRequest.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiRequest.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiResponse.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiResponse.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/IWidgetApiResponse.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/LanguageChangeAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/LanguageChangeAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/LanguageChangeAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalButtonKind.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalButtonKind.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalButtonKind.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalWidgetActions.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalWidgetActions.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ModalWidgetActions.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/NavigateAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/NavigateAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/NavigateAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/OpenIDCredentialsAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/OpenIDCredentialsAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/OpenIDCredentialsAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadEventAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadEventAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadEventAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRelationsAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRelationsAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRelationsAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRoomAccountDataAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRoomAccountDataAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ReadRoomAccountDataAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcLivekitActions.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcLivekitActions.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcLivekitActions.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcTransportsAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcTransportsAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/RtcTransportsAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ScreenshotAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ScreenshotAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ScreenshotAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendEventAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendEventAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendEventAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendToDeviceAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendToDeviceAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SendToDeviceAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SetModalButtonEnabledAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SetModalButtonEnabledAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SetModalButtonEnabledAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickerAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickerAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickerAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickyAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickyAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/StickyAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SupportedVersionsAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SupportedVersionsAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/SupportedVersionsAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ThemeChangeAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ThemeChangeAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/ThemeChangeAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/TurnServerActions.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/TurnServerActions.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/TurnServerActions.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateDelayedEventAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateDelayedEventAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateDelayedEventAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateStateAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateStateAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UpdateStateAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UploadFileAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UploadFileAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UploadFileAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UserDirectorySearchAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UserDirectorySearchAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/UserDirectorySearchAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/VisibilityAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/VisibilityAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/VisibilityAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiDirection.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiDirection.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetApiDirection.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetConfigAction.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetConfigAction.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetConfigAction.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetKind.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetKind.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetKind.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetType.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetType.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/interfaces/WidgetType.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/Widget.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/Widget.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/Widget.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetEventCapability.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetEventCapability.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetEventCapability.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetParser.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetParser.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/WidgetParser.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/url.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/url.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/url.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/utils.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/utils.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/models/validation/utils.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/templating/url-template.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/templating/url-template.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/templating/url-template.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/ITransport.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/ITransport.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/ITransport.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/PostmessageTransport.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/PostmessageTransport.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/transport/PostmessageTransport.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/util/SimpleObservable.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/util/SimpleObservable.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/lib/util/SimpleObservable.js.map +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/ClientWidgetApi.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/Symbols.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/WidgetApi.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/driver/WidgetDriver.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/index.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ApiVersion.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/Capabilities.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/CapabilitiesAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ContentLoadedAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/DownloadFileAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/GetMediaConfigAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/GetOpenIDAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ICustomWidgetData.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IJitsiWidgetData.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IRoomAccountData.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IRoomEvent.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IStickerpickerWidgetData.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IToDeviceMessage.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IWidget.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IWidgetApiErrorResponse.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IWidgetApiRequest.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/IWidgetApiResponse.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/LanguageChangeAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ModalButtonKind.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ModalWidgetActions.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/NavigateAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/OpenIDCredentialsAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ReadEventAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ReadRelationsAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ReadRoomAccountDataAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/RtcLivekitActions.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/RtcTransportsAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ScreenshotAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/SendEventAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/SendToDeviceAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/SetModalButtonEnabledAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/StickerAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/StickyAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/SupportedVersionsAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/ThemeChangeAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/TurnServerActions.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/UpdateDelayedEventAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/UpdateStateAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/UploadFileAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/UserDirectorySearchAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/VisibilityAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/WidgetApiAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/WidgetApiDirection.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/WidgetConfigAction.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/WidgetKind.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/interfaces/WidgetType.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/models/Widget.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/models/WidgetEventCapability.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/models/WidgetParser.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/models/validation/url.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/models/validation/utils.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/templating/url-template.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/transport/ITransport.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/transport/PostmessageTransport.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/matrix-widget-api → matrix-widget-api}/src/util/SimpleObservable.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/LICENSE +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/README.md +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/build/index.cjs.js +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/index.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/lib/decode.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/lib/encode.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/lib/format.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/lib/index.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/lib/parse.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/mdurl → mdurl}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/LICENSE +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/dist/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/dist/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/dist/index.js.map +0 -0
- /package/node_modules/{music-metadata/node_modules/media-typer → media-typer}/package.json +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/ms → ms}/index.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/ms → ms}/license.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/ms → ms}/package.json +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/ms → ms}/readme.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/LICENSE +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/README.md +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/bin/helpers.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/bin/ndh +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/dist/index.js +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/package.json +0 -0
- /package/node_modules/{@matrix-org/matrix-sdk-crypto-nodejs/node_modules/node-downloader-helper → node-downloader-helper}/types/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/p-retry → p-retry}/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/p-retry → p-retry}/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/file-type → p-retry}/license +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/p-retry → p-retry}/package.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/p-retry → p-retry}/readme.md +0 -0
- /package/node_modules/{markdown-it/node_modules/punycode.js → punycode.js}/LICENSE-MIT.txt +0 -0
- /package/node_modules/{markdown-it/node_modules/punycode.js → punycode.js}/README.md +0 -0
- /package/node_modules/{markdown-it/node_modules/punycode.js → punycode.js}/package.json +0 -0
- /package/node_modules/{markdown-it/node_modules/punycode.js → punycode.js}/punycode.es6.js +0 -0
- /package/node_modules/{markdown-it/node_modules/punycode.js → punycode.js}/punycode.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/.eslintrc.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/.github/FUNDING.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/.github/codecov.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/.github/dependabot.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/.github/workflows/ci.yml +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/CHANGELOG.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/checker.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/lib/grammar.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/lib/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/lib/parser.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/lib/writer.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/sdp-transform → sdp-transform}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/LICENSE.txt +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/AbstractTokenizer.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/AbstractTokenizer.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/BlobTokenizer.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/BlobTokenizer.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/BufferTokenizer.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/BufferTokenizer.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/FileTokenizer.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/FileTokenizer.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/ReadStreamTokenizer.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/ReadStreamTokenizer.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/core.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/core.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/AbstractStreamReader.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/AbstractStreamReader.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/Deferred.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/Deferred.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/Errors.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/Errors.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/StreamReader.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/StreamReader.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamByobReader.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamByobReader.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamDefaultReader.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamDefaultReader.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamReader.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamReader.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamReaderFactory.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/WebStreamReaderFactory.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/stream/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/lib/types.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/strtok3 → strtok3}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/token-types → token-types}/LICENSE.txt +0 -0
- /package/node_modules/{music-metadata/node_modules/token-types → token-types}/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/token-types → token-types}/lib/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/token-types → token-types}/lib/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/token-types → token-types}/package.json +0 -0
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/LICENSE.txt +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/README.md +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/build/index.cjs.js +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/build/index.d.ts +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/build/index.mjs +0 -0
- /package/node_modules/{markdown-it/node_modules/uc.micro → uc.micro}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/uint8array-extras → uint8array-extras}/index.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/uint8array-extras → uint8array-extras}/index.js +0 -0
- /package/node_modules/{music-metadata/node_modules/uint8array-extras → uint8array-extras}/license +0 -0
- /package/node_modules/{music-metadata/node_modules/uint8array-extras → uint8array-extras}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/uint8array-extras → uint8array-extras}/readme.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/CHANGELOG.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/LICENSE +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/README.md +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/data.json +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/index.d.ts +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/index.js +0 -0
- /package/node_modules/{matrix-js-sdk/node_modules/unhomoglyph → unhomoglyph}/package.json +0 -0
- /package/node_modules/{music-metadata/node_modules/win-guid → win-guid}/LICENSE.txt +0 -0
- /package/node_modules/{music-metadata/node_modules/win-guid → win-guid}/README.md +0 -0
- /package/node_modules/{music-metadata/node_modules/win-guid → win-guid}/lib/guid.d.ts +0 -0
- /package/node_modules/{music-metadata/node_modules/win-guid → win-guid}/lib/guid.js +0 -0
- /package/node_modules/{music-metadata/node_modules/win-guid → win-guid}/package.json +0 -0
|
@@ -1,4544 +0,0 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
-
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
-
import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-iThMol10.mjs";
|
|
4
|
-
import { _ as toLocationContext, a as resolveMatrixRoomConfig, c as canonicalizeAllowlistWithResolvedIds, d as formatLocationText, f as getAgentScopedMediaLocalRoots, g as summarizeMapping, h as patchAllowlistUsersInConfigEntries, i as resolveMatrixThreadRouting, l as createReplyPrefixOptions, m as logTypingFailure, n as resolveMatrixStoredSessionMeta, o as addAllowlistUserEntriesFromConfigEntry, p as logInboundDrop, r as resolveMatrixInboundRoute, s as buildAllowlistResolutionSummary, u as createTypingCallbacks } from "./channel-ConuJfxT.mjs";
|
|
5
|
-
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-C6KvBV8l.mjs";
|
|
6
|
-
import { n as isMatrixRoomId, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
7
|
-
import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-BrGXL7b8.mjs";
|
|
8
|
-
import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-B2Bno2xL.mjs";
|
|
9
|
-
import { S as parsePollStartContent, _ as formatPollAsText, b as isPollStartType, c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, l as formatMatrixMediaUnavailableText, p as resolveMatrixReplacementContent, r as sendMessageMatrix, u as formatMatrixMessageText, y as isPollEventType } from "./send-aVdC5NJO.mjs";
|
|
10
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-JlnLDfPM.mjs";
|
|
11
|
-
import { i as readMatrixMessages, u as fetchMatrixPollSnapshot } from "./messages-COuAcrz-.mjs";
|
|
12
|
-
import { c as createMatrixMonitorTaskRunner, d as resolveMatrixAuth, f as resolveMatrixAuthContext, l as getMatrixMonitorTaskSignal, o as isMatrixStartupAbortError, r as acquireSharedMatrixClient, s as throwIfMatrixStartupAborted, u as backfillMatrixAuthDeviceIdAfterStartup } from "./client-ChrXpxos.mjs";
|
|
13
|
-
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-Bi6uKmzh.mjs";
|
|
14
|
-
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-B508VPBM.mjs";
|
|
15
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-BLz748lX.mjs";
|
|
16
|
-
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-CMWXiBzJ.mjs";
|
|
17
|
-
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-BSlv35xl.mjs";
|
|
18
|
-
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-Bn9Bk0-H.mjs";
|
|
19
|
-
import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-DTyP1k5g.mjs";
|
|
20
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
21
|
-
import { createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
22
|
-
import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
|
-
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
24
|
-
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
25
|
-
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
26
|
-
import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
|
|
27
|
-
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
28
|
-
import { createAcceptedChannelDeliveryResult, createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, hasFinalInboundReplyDispatch, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
29
|
-
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
30
|
-
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
31
|
-
import { escapeRegExp, sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
32
|
-
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
33
|
-
import { format } from "node:util";
|
|
34
|
-
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
35
|
-
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
36
|
-
import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
37
|
-
import { resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingMaxAgeMsForChannel } from "openclaw/plugin-sdk/thread-bindings-runtime";
|
|
38
|
-
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
39
|
-
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
40
|
-
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
41
|
-
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
42
|
-
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
43
|
-
import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
44
|
-
import { resolveAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
45
|
-
import { createChannelPreflightAudio, formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
46
|
-
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
47
|
-
import { buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
|
|
48
|
-
import { decodeHtmlEntities } from "openclaw/plugin-sdk/html-entity-runtime";
|
|
49
|
-
import { channelBlockedPatch, channelReadyPatch, channelStoppedPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
50
|
-
//#region extensions/matrix/src/matrix/monitor/auto-join.ts
|
|
51
|
-
function registerMatrixAutoJoin(params) {
|
|
52
|
-
const { client, accountConfig, runtime } = params;
|
|
53
|
-
const core = getMatrixRuntime();
|
|
54
|
-
const logVerbose = (message) => {
|
|
55
|
-
if (!core.logging.shouldLogVerbose()) return;
|
|
56
|
-
runtime.log?.(message);
|
|
57
|
-
};
|
|
58
|
-
const autoJoin = accountConfig.autoJoin ?? "off";
|
|
59
|
-
const rawAllowlist = normalizeStringifiedEntries(accountConfig.autoJoinAllowlist ?? []);
|
|
60
|
-
const autoJoinAllowlist = new Set(rawAllowlist);
|
|
61
|
-
const allowedRoomIds = new Set(rawAllowlist.filter((entry) => entry.startsWith("!")));
|
|
62
|
-
const allowedAliases = rawAllowlist.filter((entry) => entry.startsWith("#"));
|
|
63
|
-
const resolvedAliasRoomIds = /* @__PURE__ */ new Map();
|
|
64
|
-
if (autoJoin === "off") return () => {};
|
|
65
|
-
if (autoJoin === "always") logVerbose("matrix: auto-join enabled for all invites");
|
|
66
|
-
else logVerbose("matrix: auto-join enabled for allowlist invites");
|
|
67
|
-
const resolveAllowedAliasRoomId = async (alias) => {
|
|
68
|
-
if (resolvedAliasRoomIds.has(alias)) return resolvedAliasRoomIds.get(alias) ?? null;
|
|
69
|
-
const resolved = await params.client.resolveRoom(alias);
|
|
70
|
-
if (resolved) resolvedAliasRoomIds.set(alias, resolved);
|
|
71
|
-
return resolved;
|
|
72
|
-
};
|
|
73
|
-
const resolveAllowedAliasRoomIds = async () => {
|
|
74
|
-
return (await Promise.all(allowedAliases.map(async (alias) => {
|
|
75
|
-
try {
|
|
76
|
-
return await resolveAllowedAliasRoomId(alias);
|
|
77
|
-
} catch (err) {
|
|
78
|
-
runtime.error?.(`matrix: failed resolving allowlisted alias ${alias}: ${String(err)}`);
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
}))).filter((roomId) => Boolean(roomId));
|
|
82
|
-
};
|
|
83
|
-
const onInvite = (roomId, _inviteEvent) => {
|
|
84
|
-
params.runDetachedTask(`auto-join invite handler room=${roomId}`, async () => {
|
|
85
|
-
if (autoJoin === "allowlist") {
|
|
86
|
-
const allowedAliasRoomIds = await resolveAllowedAliasRoomIds();
|
|
87
|
-
if (!(autoJoinAllowlist.has("*") || allowedRoomIds.has(roomId) || allowedAliasRoomIds.some((resolvedRoomId) => resolvedRoomId === roomId))) {
|
|
88
|
-
logVerbose(`matrix: invite ignored (not in allowlist) room=${roomId}`);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
await client.joinRoom(roomId);
|
|
94
|
-
logVerbose(`matrix: joined room ${roomId}`);
|
|
95
|
-
} catch (err) {
|
|
96
|
-
runtime.error?.(`matrix: failed to join room ${roomId}: ${String(err)}`);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
client.on("room.invite", onInvite);
|
|
101
|
-
return () => {
|
|
102
|
-
client.off("room.invite", onInvite);
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region extensions/matrix/src/matrix/monitor/config.ts
|
|
107
|
-
function normalizeMatrixUserLookupEntry(raw) {
|
|
108
|
-
return raw.replace(/^matrix:/i, "").replace(/^user:/i, "").trim();
|
|
109
|
-
}
|
|
110
|
-
function normalizeMatrixRoomLookupEntry(raw) {
|
|
111
|
-
return raw.replace(/^matrix:/i, "").replace(/^(room|channel):/i, "").trim();
|
|
112
|
-
}
|
|
113
|
-
function filterResolvedMatrixAllowlistEntries(entries) {
|
|
114
|
-
return entries.filter((entry) => {
|
|
115
|
-
const trimmed = entry.trim();
|
|
116
|
-
if (!trimmed) return false;
|
|
117
|
-
if (trimmed === "*") return true;
|
|
118
|
-
return isMatrixQualifiedUserId(normalizeMatrixUserLookupEntry(trimmed));
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
function filterFailClosedMatrixAllowlistEntries(entries) {
|
|
122
|
-
return entries.filter((entry) => entry.trim().length > 0);
|
|
123
|
-
}
|
|
124
|
-
function listResolvedMatrixAllowlistEntries(params) {
|
|
125
|
-
const resolvedEntries = [];
|
|
126
|
-
const seen = /* @__PURE__ */ new Set();
|
|
127
|
-
for (const entry of params.entries) {
|
|
128
|
-
const input = String(entry).trim();
|
|
129
|
-
if (!input || seen.has(input)) continue;
|
|
130
|
-
seen.add(input);
|
|
131
|
-
const resolved = params.resolvedMap.get(input);
|
|
132
|
-
if (!resolved?.resolved || !resolved.id) continue;
|
|
133
|
-
const id = normalizeMatrixUserId(resolved.id);
|
|
134
|
-
if (isMatrixQualifiedUserId(id)) resolvedEntries.push({
|
|
135
|
-
input,
|
|
136
|
-
id
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
return resolvedEntries;
|
|
140
|
-
}
|
|
141
|
-
function normalizeConfiguredMatrixAllowlistEntries(entries) {
|
|
142
|
-
const normalized = [];
|
|
143
|
-
for (const entry of entries ?? []) {
|
|
144
|
-
const trimmed = String(entry).trim();
|
|
145
|
-
if (trimmed) normalized.push(trimmed);
|
|
146
|
-
}
|
|
147
|
-
return normalized;
|
|
148
|
-
}
|
|
149
|
-
function isMatrixDangerousNameMatchingEnabled(params) {
|
|
150
|
-
return isDangerousNameMatchingEnabled(resolveMatrixAccountConfig({
|
|
151
|
-
cfg: params.cfg,
|
|
152
|
-
accountId: params.accountId
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
function addUniqueMatrixAllowlistEntry(params) {
|
|
156
|
-
const trimmed = params.entry.trim();
|
|
157
|
-
if (!trimmed) return;
|
|
158
|
-
const key = normalizeMatrixUserId(trimmed);
|
|
159
|
-
if (params.seen.has(key)) return;
|
|
160
|
-
params.seen.add(key);
|
|
161
|
-
params.entries.push(trimmed);
|
|
162
|
-
}
|
|
163
|
-
function resolveStableMatrixMonitorUserEntries(entries) {
|
|
164
|
-
const directMatches = [];
|
|
165
|
-
for (const entry of entries) {
|
|
166
|
-
const input = String(entry).trim();
|
|
167
|
-
if (!input) continue;
|
|
168
|
-
const query = normalizeMatrixUserLookupEntry(input);
|
|
169
|
-
if (!query || query === "*") continue;
|
|
170
|
-
directMatches.push(isMatrixQualifiedUserId(query) ? {
|
|
171
|
-
input,
|
|
172
|
-
resolved: true,
|
|
173
|
-
id: normalizeMatrixUserId(query)
|
|
174
|
-
} : {
|
|
175
|
-
input,
|
|
176
|
-
resolved: false
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
return buildAllowlistResolutionSummary(directMatches);
|
|
180
|
-
}
|
|
181
|
-
function logStableMatrixAllowlistUnresolved(params) {
|
|
182
|
-
if (params.unresolved.length === 0) return;
|
|
183
|
-
summarizeMapping(params.label, [], params.unresolved, params.runtime);
|
|
184
|
-
params.runtime.log?.(`${params.label} entries must be full Matrix IDs (example: @user:server). Unresolved entries will not match any sender. To match Matrix display names, set channels.matrix.dangerouslyAllowNameMatching=true.`);
|
|
185
|
-
}
|
|
186
|
-
function resolveStableMatrixMonitorUserAllowlist(params) {
|
|
187
|
-
const allowList = params.allowList;
|
|
188
|
-
const resolution = resolveStableMatrixMonitorUserEntries(allowList);
|
|
189
|
-
const canonicalized = canonicalizeAllowlistWithResolvedIds({
|
|
190
|
-
existing: allowList,
|
|
191
|
-
resolvedMap: resolution.resolvedMap,
|
|
192
|
-
entryKey: normalizeMatrixUserId
|
|
193
|
-
});
|
|
194
|
-
logStableMatrixAllowlistUnresolved({
|
|
195
|
-
label: params.label,
|
|
196
|
-
unresolved: resolution.unresolved,
|
|
197
|
-
runtime: params.runtime
|
|
198
|
-
});
|
|
199
|
-
return {
|
|
200
|
-
entries: params.failClosedOnUnresolved ? filterFailClosedMatrixAllowlistEntries(canonicalized) : filterResolvedMatrixAllowlistEntries(canonicalized),
|
|
201
|
-
resolvedEntries: listResolvedMatrixAllowlistEntries({
|
|
202
|
-
entries: allowList,
|
|
203
|
-
resolvedMap: resolution.resolvedMap
|
|
204
|
-
})
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
async function resolveMatrixMonitorUserEntries(params) {
|
|
208
|
-
const directMatches = [];
|
|
209
|
-
const pending = [];
|
|
210
|
-
for (const entry of params.entries) {
|
|
211
|
-
const input = String(entry).trim();
|
|
212
|
-
if (!input) continue;
|
|
213
|
-
const query = normalizeMatrixUserLookupEntry(input);
|
|
214
|
-
if (!query || query === "*") continue;
|
|
215
|
-
if (isMatrixQualifiedUserId(query)) {
|
|
216
|
-
directMatches.push({
|
|
217
|
-
input,
|
|
218
|
-
resolved: true,
|
|
219
|
-
id: normalizeMatrixUserId(query)
|
|
220
|
-
});
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
pending.push({
|
|
224
|
-
input,
|
|
225
|
-
query
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
(pending.length === 0 ? [] : await params.resolveTargets({
|
|
229
|
-
cfg: params.cfg,
|
|
230
|
-
accountId: params.accountId,
|
|
231
|
-
inputs: pending.map((entry) => entry.query),
|
|
232
|
-
kind: "user",
|
|
233
|
-
runtime: params.runtime
|
|
234
|
-
})).forEach((entry, index) => {
|
|
235
|
-
const source = pending[index];
|
|
236
|
-
if (!source) return;
|
|
237
|
-
directMatches.push({
|
|
238
|
-
input: source.input,
|
|
239
|
-
resolved: entry.resolved,
|
|
240
|
-
id: entry.id ? normalizeMatrixUserId(entry.id) : void 0
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
return buildAllowlistResolutionSummary(directMatches);
|
|
244
|
-
}
|
|
245
|
-
async function resolveMatrixMonitorUserAllowlist(params) {
|
|
246
|
-
const allowList = (params.list ?? []).map(String);
|
|
247
|
-
if (allowList.length === 0) return {
|
|
248
|
-
entries: allowList,
|
|
249
|
-
resolvedEntries: []
|
|
250
|
-
};
|
|
251
|
-
if (!isMatrixDangerousNameMatchingEnabled({
|
|
252
|
-
cfg: params.cfg,
|
|
253
|
-
accountId: params.accountId
|
|
254
|
-
})) return resolveStableMatrixMonitorUserAllowlist({
|
|
255
|
-
allowList,
|
|
256
|
-
failClosedOnUnresolved: params.failClosedOnUnresolved,
|
|
257
|
-
label: params.label,
|
|
258
|
-
runtime: params.runtime
|
|
259
|
-
});
|
|
260
|
-
const resolution = await resolveMatrixMonitorUserEntries({
|
|
261
|
-
cfg: params.cfg,
|
|
262
|
-
accountId: params.accountId,
|
|
263
|
-
entries: allowList,
|
|
264
|
-
runtime: params.runtime,
|
|
265
|
-
resolveTargets: params.resolveTargets
|
|
266
|
-
});
|
|
267
|
-
const canonicalized = canonicalizeAllowlistWithResolvedIds({
|
|
268
|
-
existing: allowList,
|
|
269
|
-
resolvedMap: resolution.resolvedMap,
|
|
270
|
-
entryKey: normalizeMatrixUserId
|
|
271
|
-
});
|
|
272
|
-
summarizeMapping(params.label, resolution.mapping, resolution.unresolved, params.runtime);
|
|
273
|
-
if (resolution.unresolved.length > 0) params.runtime.log?.(`${params.label} entries must be full Matrix IDs (example: @user:server). Unresolved entries will not match any sender.`);
|
|
274
|
-
return {
|
|
275
|
-
entries: params.failClosedOnUnresolved ? filterFailClosedMatrixAllowlistEntries(canonicalized) : filterResolvedMatrixAllowlistEntries(canonicalized),
|
|
276
|
-
resolvedEntries: listResolvedMatrixAllowlistEntries({
|
|
277
|
-
entries: allowList,
|
|
278
|
-
resolvedMap: resolution.resolvedMap
|
|
279
|
-
})
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
async function resolveMatrixMonitorLiveUserAllowlist(params) {
|
|
283
|
-
const liveEntries = normalizeConfiguredMatrixAllowlistEntries(params.entries);
|
|
284
|
-
if (liveEntries.length === 0) return [];
|
|
285
|
-
const allowNameMatching = isMatrixDangerousNameMatchingEnabled({
|
|
286
|
-
cfg: params.cfg,
|
|
287
|
-
accountId: params.accountId
|
|
288
|
-
});
|
|
289
|
-
const effective = [];
|
|
290
|
-
const seen = /* @__PURE__ */ new Set();
|
|
291
|
-
const startupByInput = new Map((params.startupResolvedEntries ?? []).map((entry) => [entry.input, entry.id]));
|
|
292
|
-
const pending = [];
|
|
293
|
-
for (const entry of liveEntries) {
|
|
294
|
-
const query = normalizeMatrixUserLookupEntry(entry);
|
|
295
|
-
if (entry === "*") {
|
|
296
|
-
addUniqueMatrixAllowlistEntry({
|
|
297
|
-
entries: effective,
|
|
298
|
-
seen,
|
|
299
|
-
entry
|
|
300
|
-
});
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
if (isMatrixQualifiedUserId(query)) {
|
|
304
|
-
addUniqueMatrixAllowlistEntry({
|
|
305
|
-
entries: effective,
|
|
306
|
-
seen,
|
|
307
|
-
entry: normalizeMatrixUserId(query)
|
|
308
|
-
});
|
|
309
|
-
continue;
|
|
310
|
-
}
|
|
311
|
-
const startupId = startupByInput.get(entry);
|
|
312
|
-
if (allowNameMatching && startupId) {
|
|
313
|
-
addUniqueMatrixAllowlistEntry({
|
|
314
|
-
entries: effective,
|
|
315
|
-
seen,
|
|
316
|
-
entry: startupId
|
|
317
|
-
});
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
if (allowNameMatching) {
|
|
321
|
-
pending.push(entry);
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
if (params.failClosedOnUnresolved) addUniqueMatrixAllowlistEntry({
|
|
325
|
-
entries: effective,
|
|
326
|
-
seen,
|
|
327
|
-
entry
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
if (pending.length === 0) return effective;
|
|
331
|
-
const resolution = await resolveMatrixMonitorUserEntries({
|
|
332
|
-
cfg: params.cfg,
|
|
333
|
-
accountId: params.accountId,
|
|
334
|
-
entries: pending,
|
|
335
|
-
runtime: params.runtime,
|
|
336
|
-
resolveTargets: params.resolveTargets ?? resolveMatrixTargets
|
|
337
|
-
});
|
|
338
|
-
const canonicalized = canonicalizeAllowlistWithResolvedIds({
|
|
339
|
-
existing: pending,
|
|
340
|
-
resolvedMap: resolution.resolvedMap,
|
|
341
|
-
entryKey: normalizeMatrixUserId
|
|
342
|
-
});
|
|
343
|
-
const resolvedEntries = params.failClosedOnUnresolved ? filterFailClosedMatrixAllowlistEntries(canonicalized) : filterResolvedMatrixAllowlistEntries(canonicalized);
|
|
344
|
-
for (const entry of resolvedEntries) addUniqueMatrixAllowlistEntry({
|
|
345
|
-
entries: effective,
|
|
346
|
-
seen,
|
|
347
|
-
entry
|
|
348
|
-
});
|
|
349
|
-
return effective;
|
|
350
|
-
}
|
|
351
|
-
async function resolveMatrixMonitorRoomsConfig(params) {
|
|
352
|
-
const roomsConfig = params.roomsConfig;
|
|
353
|
-
if (!roomsConfig || Object.keys(roomsConfig).length === 0) return roomsConfig;
|
|
354
|
-
const mapping = [];
|
|
355
|
-
const unresolved = [];
|
|
356
|
-
const nextRooms = {};
|
|
357
|
-
const allowNameMatching = isMatrixDangerousNameMatchingEnabled({
|
|
358
|
-
cfg: params.cfg,
|
|
359
|
-
accountId: params.accountId
|
|
360
|
-
});
|
|
361
|
-
if (roomsConfig["*"]) nextRooms["*"] = roomsConfig["*"];
|
|
362
|
-
const pending = [];
|
|
363
|
-
for (const [entry, roomConfig] of Object.entries(roomsConfig)) {
|
|
364
|
-
if (entry === "*") continue;
|
|
365
|
-
const input = entry.trim();
|
|
366
|
-
if (!input) continue;
|
|
367
|
-
const cleaned = normalizeMatrixRoomLookupEntry(input);
|
|
368
|
-
if (!cleaned) {
|
|
369
|
-
unresolved.push(entry);
|
|
370
|
-
continue;
|
|
371
|
-
}
|
|
372
|
-
if (isMatrixRoomId(cleaned)) {
|
|
373
|
-
if (!nextRooms[cleaned]) nextRooms[cleaned] = roomConfig;
|
|
374
|
-
if (cleaned !== input) mapping.push(`${input}→${cleaned}`);
|
|
375
|
-
continue;
|
|
376
|
-
}
|
|
377
|
-
if (!cleaned.startsWith("#") && !allowNameMatching) {
|
|
378
|
-
unresolved.push(input);
|
|
379
|
-
continue;
|
|
380
|
-
}
|
|
381
|
-
pending.push({
|
|
382
|
-
input,
|
|
383
|
-
query: cleaned,
|
|
384
|
-
config: roomConfig
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
if (pending.length > 0) (await params.resolveTargets({
|
|
388
|
-
cfg: params.cfg,
|
|
389
|
-
accountId: params.accountId,
|
|
390
|
-
inputs: pending.map((entry) => entry.query),
|
|
391
|
-
kind: "group",
|
|
392
|
-
runtime: params.runtime
|
|
393
|
-
})).forEach((entry, index) => {
|
|
394
|
-
const source = pending[index];
|
|
395
|
-
if (!source) return;
|
|
396
|
-
if (entry.resolved && entry.id) {
|
|
397
|
-
const roomKey = normalizeMatrixRoomLookupEntry(entry.id);
|
|
398
|
-
if (!nextRooms[roomKey]) nextRooms[roomKey] = source.config;
|
|
399
|
-
mapping.push(`${source.input}→${roomKey}`);
|
|
400
|
-
} else unresolved.push(source.input);
|
|
401
|
-
});
|
|
402
|
-
summarizeMapping("matrix rooms", mapping, unresolved, params.runtime);
|
|
403
|
-
if (unresolved.length > 0) params.runtime.log?.("matrix rooms must be room IDs or aliases (example: !room:server, the suffixless !room form on room version 12+, or #alias:server). Unresolved entries are ignored.");
|
|
404
|
-
const roomUsers = /* @__PURE__ */ new Set();
|
|
405
|
-
for (const roomConfig of Object.values(nextRooms)) addAllowlistUserEntriesFromConfigEntry(roomUsers, roomConfig);
|
|
406
|
-
if (roomUsers.size === 0) return nextRooms;
|
|
407
|
-
if (!allowNameMatching) {
|
|
408
|
-
const resolution = resolveStableMatrixMonitorUserEntries(Array.from(roomUsers));
|
|
409
|
-
logStableMatrixAllowlistUnresolved({
|
|
410
|
-
label: "matrix room users",
|
|
411
|
-
unresolved: resolution.unresolved,
|
|
412
|
-
runtime: params.runtime
|
|
413
|
-
});
|
|
414
|
-
return patchAllowlistUsersInConfigEntries({
|
|
415
|
-
entries: nextRooms,
|
|
416
|
-
resolvedMap: resolution.resolvedMap,
|
|
417
|
-
strategy: "canonicalize",
|
|
418
|
-
entryKey: normalizeMatrixUserId
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
const resolution = await resolveMatrixMonitorUserEntries({
|
|
422
|
-
cfg: params.cfg,
|
|
423
|
-
accountId: params.accountId,
|
|
424
|
-
entries: Array.from(roomUsers),
|
|
425
|
-
runtime: params.runtime,
|
|
426
|
-
resolveTargets: params.resolveTargets
|
|
427
|
-
});
|
|
428
|
-
summarizeMapping("matrix room users", resolution.mapping, resolution.unresolved, params.runtime);
|
|
429
|
-
if (resolution.unresolved.length > 0) params.runtime.log?.("matrix room users entries must be full Matrix IDs (example: @user:server). Unresolved entries will not match any sender.");
|
|
430
|
-
return patchAllowlistUsersInConfigEntries({
|
|
431
|
-
entries: nextRooms,
|
|
432
|
-
resolvedMap: resolution.resolvedMap,
|
|
433
|
-
strategy: "canonicalize",
|
|
434
|
-
entryKey: normalizeMatrixUserId
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
async function resolveMatrixMonitorConfig(params) {
|
|
438
|
-
const resolveTargets = params.resolveTargets ?? resolveMatrixTargets;
|
|
439
|
-
const [allowFrom, groupAllowFrom, roomsConfig] = await Promise.all([
|
|
440
|
-
resolveMatrixMonitorUserAllowlist({
|
|
441
|
-
cfg: params.cfg,
|
|
442
|
-
accountId: params.accountId,
|
|
443
|
-
label: "matrix dm allowlist",
|
|
444
|
-
list: params.allowFrom,
|
|
445
|
-
runtime: params.runtime,
|
|
446
|
-
resolveTargets
|
|
447
|
-
}),
|
|
448
|
-
resolveMatrixMonitorUserAllowlist({
|
|
449
|
-
cfg: params.cfg,
|
|
450
|
-
accountId: params.accountId,
|
|
451
|
-
label: "matrix group allowlist",
|
|
452
|
-
list: params.groupAllowFrom,
|
|
453
|
-
failClosedOnUnresolved: true,
|
|
454
|
-
runtime: params.runtime,
|
|
455
|
-
resolveTargets
|
|
456
|
-
}),
|
|
457
|
-
resolveMatrixMonitorRoomsConfig({
|
|
458
|
-
cfg: params.cfg,
|
|
459
|
-
accountId: params.accountId,
|
|
460
|
-
roomsConfig: params.roomsConfig,
|
|
461
|
-
runtime: params.runtime,
|
|
462
|
-
resolveTargets
|
|
463
|
-
})
|
|
464
|
-
]);
|
|
465
|
-
return {
|
|
466
|
-
allowFrom: allowFrom.entries,
|
|
467
|
-
allowFromResolvedEntries: allowFrom.resolvedEntries,
|
|
468
|
-
groupAllowFrom: groupAllowFrom.entries,
|
|
469
|
-
groupAllowFromResolvedEntries: groupAllowFrom.resolvedEntries,
|
|
470
|
-
roomsConfig
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
//#endregion
|
|
474
|
-
//#region extensions/matrix/src/matrix/monitor/direct.ts
|
|
475
|
-
const DM_CACHE_TTL_MS = 3e4;
|
|
476
|
-
const RECENT_INVITE_TTL_MS = 3e4;
|
|
477
|
-
const MAX_DM_ROOMS = 1024;
|
|
478
|
-
const MAX_DM_MEMBER_FLAGS = 2048;
|
|
479
|
-
function createDirectRoomTracker(client, opts = {}) {
|
|
480
|
-
const log = opts.log ?? (() => {});
|
|
481
|
-
let lastDmUpdateMs = 0;
|
|
482
|
-
let hasSeededDmCache = false;
|
|
483
|
-
let cachedSelfUserId = null;
|
|
484
|
-
const joinedMembersCache = /* @__PURE__ */ new Map();
|
|
485
|
-
const directMemberFlagCache = /* @__PURE__ */ new Map();
|
|
486
|
-
const recentInviteCandidates = /* @__PURE__ */ new Map();
|
|
487
|
-
const locallyPromotedDirectRooms = /* @__PURE__ */ new Map();
|
|
488
|
-
const ensureSelfUserId = async () => {
|
|
489
|
-
if (cachedSelfUserId) return cachedSelfUserId;
|
|
490
|
-
try {
|
|
491
|
-
cachedSelfUserId = await client.getUserId();
|
|
492
|
-
} catch {
|
|
493
|
-
cachedSelfUserId = null;
|
|
494
|
-
}
|
|
495
|
-
return cachedSelfUserId;
|
|
496
|
-
};
|
|
497
|
-
const refreshDmCache = async () => {
|
|
498
|
-
const now = Date.now();
|
|
499
|
-
if (now - lastDmUpdateMs < DM_CACHE_TTL_MS) return;
|
|
500
|
-
lastDmUpdateMs = now;
|
|
501
|
-
hasSeededDmCache = await client.dms.update() || hasSeededDmCache;
|
|
502
|
-
};
|
|
503
|
-
const resolveJoinedMembers = async (roomId) => {
|
|
504
|
-
const cached = joinedMembersCache.get(roomId);
|
|
505
|
-
const now = Date.now();
|
|
506
|
-
if (cached && now - cached.ts < DM_CACHE_TTL_MS) return cached.members;
|
|
507
|
-
try {
|
|
508
|
-
const normalized = await readJoinedMatrixMembers(client, roomId);
|
|
509
|
-
if (!normalized) throw new Error("membership unavailable");
|
|
510
|
-
setBoundedMap(joinedMembersCache, roomId, {
|
|
511
|
-
members: normalized,
|
|
512
|
-
ts: now
|
|
513
|
-
}, MAX_DM_ROOMS);
|
|
514
|
-
return normalized;
|
|
515
|
-
} catch (err) {
|
|
516
|
-
log(`matrix: dm member lookup failed room=${roomId} (${String(err)})`);
|
|
517
|
-
return null;
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
const resolveDirectMemberFlag = async (roomId, userId) => {
|
|
521
|
-
const normalizedUserId = userId?.trim();
|
|
522
|
-
if (!normalizedUserId) return null;
|
|
523
|
-
const cacheKey = `${roomId}\n${normalizedUserId}`;
|
|
524
|
-
const cached = directMemberFlagCache.get(cacheKey);
|
|
525
|
-
const now = Date.now();
|
|
526
|
-
if (cached && now - cached.ts < DM_CACHE_TTL_MS) return cached.isDirect;
|
|
527
|
-
const isDirect = await hasDirectMatrixMemberFlag(client, roomId, normalizedUserId);
|
|
528
|
-
setBoundedMap(directMemberFlagCache, cacheKey, {
|
|
529
|
-
isDirect,
|
|
530
|
-
ts: now
|
|
531
|
-
}, MAX_DM_MEMBER_FLAGS);
|
|
532
|
-
return isDirect;
|
|
533
|
-
};
|
|
534
|
-
const hasRecentInviteCandidate = (roomId, remoteUserId) => {
|
|
535
|
-
const normalizedRemoteUserId = remoteUserId?.trim();
|
|
536
|
-
if (!normalizedRemoteUserId) return false;
|
|
537
|
-
const cached = recentInviteCandidates.get(roomId);
|
|
538
|
-
if (!cached) return false;
|
|
539
|
-
if (Date.now() - cached.ts >= RECENT_INVITE_TTL_MS) {
|
|
540
|
-
recentInviteCandidates.delete(roomId);
|
|
541
|
-
return false;
|
|
542
|
-
}
|
|
543
|
-
return cached.remoteUserId === normalizedRemoteUserId;
|
|
544
|
-
};
|
|
545
|
-
const canPromoteRecentInvite = async (roomId) => {
|
|
546
|
-
try {
|
|
547
|
-
return await opts.canPromoteRecentInvite?.(roomId) ?? true;
|
|
548
|
-
} catch (err) {
|
|
549
|
-
log(`matrix: recent invite promotion veto failed room=${roomId} (${String(err)})`);
|
|
550
|
-
return false;
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
const canPromoteUnmappedStrictRoom = async (roomId) => {
|
|
554
|
-
try {
|
|
555
|
-
return await opts.canPromoteUnmappedStrictRoom?.(roomId) ?? false;
|
|
556
|
-
} catch (err) {
|
|
557
|
-
log(`matrix: unmapped strict room promotion veto failed room=${roomId} (${String(err)})`);
|
|
558
|
-
return false;
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
const shouldKeepLocallyPromotedDirectRoom = async (roomId) => {
|
|
562
|
-
try {
|
|
563
|
-
return await opts.shouldKeepLocallyPromotedDirectRoom?.(roomId);
|
|
564
|
-
} catch (err) {
|
|
565
|
-
log(`matrix: local promotion keep-check failed room=${roomId} (${String(err)})`);
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
const isExplicitlyConfiguredRoom = async (roomId) => {
|
|
570
|
-
try {
|
|
571
|
-
return await opts.isExplicitlyConfiguredRoom?.(roomId) ?? false;
|
|
572
|
-
} catch (err) {
|
|
573
|
-
log(`matrix: configured room check failed room=${roomId} (${String(err)})`);
|
|
574
|
-
return true;
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
const hasLocallyPromotedDirectRoom = (roomId, remoteUserId) => {
|
|
578
|
-
const normalizedRemoteUserId = remoteUserId?.trim();
|
|
579
|
-
if (!normalizedRemoteUserId) return false;
|
|
580
|
-
return locallyPromotedDirectRooms.get(roomId)?.remoteUserId === normalizedRemoteUserId;
|
|
581
|
-
};
|
|
582
|
-
const rememberLocallyPromotedDirectRoom = (roomId, remoteUserId) => {
|
|
583
|
-
const normalizedRemoteUserId = remoteUserId.trim();
|
|
584
|
-
if (!normalizedRemoteUserId) return;
|
|
585
|
-
setBoundedMap(locallyPromotedDirectRooms, roomId, { remoteUserId: normalizedRemoteUserId }, MAX_DM_ROOMS);
|
|
586
|
-
};
|
|
587
|
-
return {
|
|
588
|
-
invalidateRoom: (roomId) => {
|
|
589
|
-
joinedMembersCache.delete(roomId);
|
|
590
|
-
for (const key of directMemberFlagCache.keys()) if (key.startsWith(`${roomId}\n`)) directMemberFlagCache.delete(key);
|
|
591
|
-
lastDmUpdateMs = 0;
|
|
592
|
-
log(`matrix: invalidated dm cache room=${roomId}`);
|
|
593
|
-
},
|
|
594
|
-
rememberInvite: (roomId, remoteUserId) => {
|
|
595
|
-
const normalizedRemoteUserId = remoteUserId.trim();
|
|
596
|
-
if (!normalizedRemoteUserId) return;
|
|
597
|
-
setBoundedMap(recentInviteCandidates, roomId, {
|
|
598
|
-
remoteUserId: normalizedRemoteUserId,
|
|
599
|
-
ts: Date.now()
|
|
600
|
-
}, MAX_DM_ROOMS);
|
|
601
|
-
log(`matrix: remembered invite candidate room=${roomId} sender=${normalizedRemoteUserId}`);
|
|
602
|
-
},
|
|
603
|
-
isDirectMessage: async (params) => {
|
|
604
|
-
const { roomId, senderId } = params;
|
|
605
|
-
if (await isExplicitlyConfiguredRoom(roomId)) {
|
|
606
|
-
log(`matrix: dm rejected via explicit room config room=${roomId}`);
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
const selfUserId = params.selfUserId ?? await ensureSelfUserId();
|
|
610
|
-
const joinedMembers = params.joinedMembers ?? await resolveJoinedMembers(roomId);
|
|
611
|
-
const strictDirectMembership = isStrictDirectMembership({
|
|
612
|
-
selfUserId,
|
|
613
|
-
remoteUserId: senderId,
|
|
614
|
-
joinedMembers
|
|
615
|
-
});
|
|
616
|
-
try {
|
|
617
|
-
await refreshDmCache();
|
|
618
|
-
} catch (err) {
|
|
619
|
-
log(`matrix: dm cache refresh failed (${String(err)})`);
|
|
620
|
-
}
|
|
621
|
-
if (client.dms.isDm(roomId)) {
|
|
622
|
-
if (strictDirectMembership) {
|
|
623
|
-
log(`matrix: dm detected via m.direct room=${roomId}`);
|
|
624
|
-
return true;
|
|
625
|
-
}
|
|
626
|
-
log(`matrix: ignoring stale m.direct classification room=${roomId}`);
|
|
627
|
-
}
|
|
628
|
-
if (strictDirectMembership) {
|
|
629
|
-
const directViaSelf = await resolveDirectMemberFlag(roomId, selfUserId);
|
|
630
|
-
if (directViaSelf === true) {
|
|
631
|
-
log(`matrix: dm detected via member state room=${roomId}`);
|
|
632
|
-
return true;
|
|
633
|
-
}
|
|
634
|
-
if (directViaSelf === false) {
|
|
635
|
-
log(`matrix: dm rejected via member state room=${roomId}`);
|
|
636
|
-
return false;
|
|
637
|
-
}
|
|
638
|
-
if (!hasSeededDmCache) {
|
|
639
|
-
log(`matrix: dm detected via exact 2-member fallback before dm cache seed room=${roomId}`);
|
|
640
|
-
return true;
|
|
641
|
-
}
|
|
642
|
-
if (hasLocallyPromotedDirectRoom(roomId, senderId)) {
|
|
643
|
-
if (await shouldKeepLocallyPromotedDirectRoom(roomId) !== false) {
|
|
644
|
-
log(`matrix: dm detected via local promotion room=${roomId}`);
|
|
645
|
-
return true;
|
|
646
|
-
}
|
|
647
|
-
locallyPromotedDirectRooms.delete(roomId);
|
|
648
|
-
log(`matrix: local promotion cleared room=${roomId}`);
|
|
649
|
-
}
|
|
650
|
-
if (hasRecentInviteCandidate(roomId, senderId) && await canPromoteRecentInvite(roomId)) {
|
|
651
|
-
const promotion = await promoteMatrixDirectRoomCandidate({
|
|
652
|
-
client,
|
|
653
|
-
remoteUserId: senderId ?? "",
|
|
654
|
-
roomId,
|
|
655
|
-
selfUserId
|
|
656
|
-
});
|
|
657
|
-
if (promotion.classifyAsDirect) {
|
|
658
|
-
rememberLocallyPromotedDirectRoom(roomId, senderId ?? "");
|
|
659
|
-
log(`matrix: dm detected via recent invite room=${roomId} reason=${promotion.reason} repaired=${String(promotion.repaired)}`);
|
|
660
|
-
return true;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
if (await canPromoteUnmappedStrictRoom(roomId)) {
|
|
664
|
-
const promotion = await promoteMatrixDirectRoomCandidate({
|
|
665
|
-
client,
|
|
666
|
-
remoteUserId: senderId ?? "",
|
|
667
|
-
roomId,
|
|
668
|
-
selfUserId
|
|
669
|
-
});
|
|
670
|
-
if (promotion.classifyAsDirect) {
|
|
671
|
-
rememberLocallyPromotedDirectRoom(roomId, senderId ?? "");
|
|
672
|
-
log(`matrix: dm detected via per-room strict fallback room=${roomId} reason=${promotion.reason} repaired=${String(promotion.repaired)}`);
|
|
673
|
-
return true;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
log(`matrix: dm check room=${roomId} result=group members=${joinedMembers?.length ?? "unknown"}`);
|
|
678
|
-
return false;
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
//#endregion
|
|
683
|
-
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
684
|
-
const EventType = {
|
|
685
|
-
RoomMessage: "m.room.message",
|
|
686
|
-
RoomMessageEncrypted: "m.room.encrypted",
|
|
687
|
-
RoomMember: "m.room.member",
|
|
688
|
-
Location: "m.location",
|
|
689
|
-
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
690
|
-
};
|
|
691
|
-
const RelationType = {
|
|
692
|
-
Replace: "m.replace",
|
|
693
|
-
Thread: "m.thread"
|
|
694
|
-
};
|
|
695
|
-
//#endregion
|
|
696
|
-
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
697
|
-
function normalizeMatrixEntry(raw) {
|
|
698
|
-
return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
|
|
699
|
-
}
|
|
700
|
-
const matrixIngressIdentity = defineStableChannelIngressIdentity({
|
|
701
|
-
key: "sender-id",
|
|
702
|
-
normalize: normalizeMatrixEntry,
|
|
703
|
-
matchEntry({ subject, entry }) {
|
|
704
|
-
const senderId = subject.identifiers[0]?.value;
|
|
705
|
-
return entry.value === "*" || resolveMatrixAllowListMatch({
|
|
706
|
-
allowList: [entry.value],
|
|
707
|
-
userId: senderId ?? ""
|
|
708
|
-
}).allowed;
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
function resolveMatrixGroupIngress(params) {
|
|
712
|
-
if (params.groupPolicy === "disabled") return {
|
|
713
|
-
groupPolicy: "disabled",
|
|
714
|
-
groupAllowFrom: []
|
|
715
|
-
};
|
|
716
|
-
if (params.effectiveRoomUsers.length > 0) return {
|
|
717
|
-
groupPolicy: "allowlist",
|
|
718
|
-
groupAllowFrom: params.effectiveRoomUsers
|
|
719
|
-
};
|
|
720
|
-
if (params.groupPolicy === "allowlist" && params.effectiveGroupAllowFrom.length > 0) return {
|
|
721
|
-
groupPolicy: "allowlist",
|
|
722
|
-
groupAllowFrom: params.effectiveGroupAllowFrom
|
|
723
|
-
};
|
|
724
|
-
return {
|
|
725
|
-
groupPolicy: "open",
|
|
726
|
-
groupAllowFrom: []
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
async function resolveMatrixMonitorAccessState(params) {
|
|
730
|
-
const dmPolicy = params.dmPolicy ?? "pairing";
|
|
731
|
-
const groupPolicy = params.groupPolicy ?? "open";
|
|
732
|
-
const effectiveGroupAllowFrom = normalizeMatrixAllowList(params.groupAllowFrom);
|
|
733
|
-
const effectiveRoomUsers = normalizeMatrixAllowList(params.roomUsers);
|
|
734
|
-
const groupIngress = resolveMatrixGroupIngress({
|
|
735
|
-
groupPolicy,
|
|
736
|
-
effectiveGroupAllowFrom,
|
|
737
|
-
effectiveRoomUsers
|
|
738
|
-
});
|
|
739
|
-
const accountId = params.accountId ?? "default";
|
|
740
|
-
const eventKind = params.eventKind ?? "message";
|
|
741
|
-
const ingress = getMatrixRuntime().channel.inbound.ingress.createResolver({
|
|
742
|
-
channelId: "matrix",
|
|
743
|
-
accountId,
|
|
744
|
-
identity: matrixIngressIdentity,
|
|
745
|
-
readStoreAllowFrom: async () => params.storeAllowFrom
|
|
746
|
-
});
|
|
747
|
-
const resolveMessageIngress = async (contextBinding, conversation) => await ingress.message({
|
|
748
|
-
subject: { stableId: params.senderId },
|
|
749
|
-
conversation: conversation ?? {
|
|
750
|
-
kind: params.isRoom ? "channel" : "direct",
|
|
751
|
-
id: params.conversationId ?? (params.isRoom ? "matrix-room" : "matrix-dm")
|
|
752
|
-
},
|
|
753
|
-
...contextBinding ? { contextBinding } : {},
|
|
754
|
-
event: {
|
|
755
|
-
kind: eventKind,
|
|
756
|
-
authMode: "inbound",
|
|
757
|
-
mayPair: params.isRoom ? false : eventKind === "message"
|
|
758
|
-
},
|
|
759
|
-
dmPolicy,
|
|
760
|
-
groupPolicy: params.isRoom ? groupIngress.groupPolicy : "disabled",
|
|
761
|
-
policy: { groupAllowFromFallbackToAllowFrom: false },
|
|
762
|
-
allowFrom: params.allowFrom,
|
|
763
|
-
...params.isRoom ? { groupAllowFrom: groupIngress.groupAllowFrom } : {}
|
|
764
|
-
});
|
|
765
|
-
return {
|
|
766
|
-
effectiveGroupAllowFrom,
|
|
767
|
-
effectiveRoomUsers,
|
|
768
|
-
messageIngress: await resolveMessageIngress(),
|
|
769
|
-
accountId,
|
|
770
|
-
senderId: params.senderId,
|
|
771
|
-
isRoom: params.isRoom,
|
|
772
|
-
resolveMessageIngress
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
async function resolveMatrixMonitorCommandAccess(state, params) {
|
|
776
|
-
const commandAllowFrom = state.isRoom ? [] : state.messageIngress.senderAccess.effectiveAllowFrom;
|
|
777
|
-
const commandGroupAllowFrom = state.effectiveRoomUsers.length > 0 ? state.effectiveRoomUsers : state.effectiveGroupAllowFrom;
|
|
778
|
-
return (await getMatrixRuntime().channel.inbound.ingress.createResolver({
|
|
779
|
-
channelId: "matrix",
|
|
780
|
-
accountId: state.accountId,
|
|
781
|
-
identity: matrixIngressIdentity
|
|
782
|
-
}).command({
|
|
783
|
-
subject: { stableId: state.senderId },
|
|
784
|
-
conversation: {
|
|
785
|
-
kind: state.isRoom ? "group" : "direct",
|
|
786
|
-
id: state.isRoom ? "matrix-room" : "matrix-dm"
|
|
787
|
-
},
|
|
788
|
-
dmPolicy: "allowlist",
|
|
789
|
-
groupPolicy: "allowlist",
|
|
790
|
-
policy: { groupAllowFromFallbackToAllowFrom: false },
|
|
791
|
-
allowFrom: commandAllowFrom,
|
|
792
|
-
groupAllowFrom: commandGroupAllowFrom,
|
|
793
|
-
command: {
|
|
794
|
-
useAccessGroups: params.useAccessGroups,
|
|
795
|
-
allowTextCommands: params.allowTextCommands,
|
|
796
|
-
hasControlCommand: params.hasControlCommand,
|
|
797
|
-
groupOwnerAllowFrom: "none",
|
|
798
|
-
commandGroupAllowFromFallbackToAllowFrom: false
|
|
799
|
-
}
|
|
800
|
-
})).commandAccess;
|
|
801
|
-
}
|
|
802
|
-
//#endregion
|
|
803
|
-
//#region extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
804
|
-
const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
|
|
805
|
-
const VERIFICATION_REQUEST_MSGTYPE = "m.key.verification.request";
|
|
806
|
-
const VERIFICATION_NOTICE_PREFIXES = [
|
|
807
|
-
"Matrix verification request received from ",
|
|
808
|
-
"Matrix verification is ready with ",
|
|
809
|
-
"Matrix verification started with ",
|
|
810
|
-
"Matrix verification completed with ",
|
|
811
|
-
"Matrix verification cancelled by ",
|
|
812
|
-
"Matrix verification SAS with "
|
|
813
|
-
];
|
|
814
|
-
function trimMaybeString(input) {
|
|
815
|
-
return normalizeOptionalString(input) ?? "";
|
|
816
|
-
}
|
|
817
|
-
function isMatrixVerificationEventType(type) {
|
|
818
|
-
return trimMaybeString(type).startsWith(VERIFICATION_EVENT_PREFIX);
|
|
819
|
-
}
|
|
820
|
-
function isMatrixVerificationRequestMsgType(msgtype) {
|
|
821
|
-
return trimMaybeString(msgtype) === VERIFICATION_REQUEST_MSGTYPE;
|
|
822
|
-
}
|
|
823
|
-
function isMatrixVerificationNoticeBody(body) {
|
|
824
|
-
const text = trimMaybeString(body);
|
|
825
|
-
return VERIFICATION_NOTICE_PREFIXES.some((prefix) => text.startsWith(prefix));
|
|
826
|
-
}
|
|
827
|
-
function isMatrixVerificationRoomMessage(content) {
|
|
828
|
-
return isMatrixVerificationRequestMsgType(content.msgtype) || trimMaybeString(content.msgtype) === "m.notice" && isMatrixVerificationNoticeBody(content.body);
|
|
829
|
-
}
|
|
830
|
-
const matrixVerificationConstants = {
|
|
831
|
-
eventPrefix: VERIFICATION_EVENT_PREFIX,
|
|
832
|
-
requestMsgtype: VERIFICATION_REQUEST_MSGTYPE
|
|
833
|
-
};
|
|
834
|
-
//#endregion
|
|
835
|
-
//#region extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
836
|
-
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
837
|
-
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
838
|
-
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
839
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-B2Bno2xL.mjs").then((n) => n.t), import("./direct-management-B2Bno2xL.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
|
|
840
|
-
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
841
|
-
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
842
|
-
})));
|
|
843
|
-
function readVerificationSignal(event) {
|
|
844
|
-
const type = normalizeNullableString(event?.type) ?? "";
|
|
845
|
-
const content = event?.content ?? {};
|
|
846
|
-
const msgtype = normalizeNullableString(content.msgtype) ?? "";
|
|
847
|
-
const relatedEventId = normalizeNullableString(content["m.relates_to"]?.event_id);
|
|
848
|
-
const transactionId = normalizeNullableString(content.transaction_id);
|
|
849
|
-
if (type === EventType.RoomMessage && isMatrixVerificationRequestMsgType(msgtype)) return {
|
|
850
|
-
stage: "request",
|
|
851
|
-
flowId: normalizeNullableString(event.event_id) ?? transactionId ?? relatedEventId
|
|
852
|
-
};
|
|
853
|
-
if (!isMatrixVerificationEventType(type)) return null;
|
|
854
|
-
const flowId = transactionId ?? relatedEventId ?? normalizeNullableString(event.event_id);
|
|
855
|
-
if (type === `${matrixVerificationConstants.eventPrefix}request`) return {
|
|
856
|
-
stage: "request",
|
|
857
|
-
flowId
|
|
858
|
-
};
|
|
859
|
-
if (type === `${matrixVerificationConstants.eventPrefix}ready`) return {
|
|
860
|
-
stage: "ready",
|
|
861
|
-
flowId
|
|
862
|
-
};
|
|
863
|
-
if (type === "m.key.verification.start") return {
|
|
864
|
-
stage: "start",
|
|
865
|
-
flowId
|
|
866
|
-
};
|
|
867
|
-
if (type === "m.key.verification.cancel") return {
|
|
868
|
-
stage: "cancel",
|
|
869
|
-
flowId
|
|
870
|
-
};
|
|
871
|
-
if (type === "m.key.verification.done") return {
|
|
872
|
-
stage: "done",
|
|
873
|
-
flowId
|
|
874
|
-
};
|
|
875
|
-
return {
|
|
876
|
-
stage: "other",
|
|
877
|
-
flowId
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
function formatVerificationStageNotice(params) {
|
|
881
|
-
const { stage, senderId, event } = params;
|
|
882
|
-
const content = event.content;
|
|
883
|
-
switch (stage) {
|
|
884
|
-
case "request": return `Matrix verification request received from ${senderId}. Open "Verify by emoji" in your Matrix client to continue.`;
|
|
885
|
-
case "ready": return `Matrix verification is ready with ${senderId}. Choose "Verify by emoji" to reveal the emoji sequence.`;
|
|
886
|
-
case "start": return `Matrix verification started with ${senderId}.`;
|
|
887
|
-
case "done": return `Matrix verification completed with ${senderId}.`;
|
|
888
|
-
case "cancel": {
|
|
889
|
-
const code = normalizeNullableString(content.code);
|
|
890
|
-
const reason = normalizeNullableString(content.reason);
|
|
891
|
-
if (code && reason) return `Matrix verification cancelled by ${senderId} (${code}: ${reason}).`;
|
|
892
|
-
if (reason) return `Matrix verification cancelled by ${senderId} (${reason}).`;
|
|
893
|
-
return `Matrix verification cancelled by ${senderId}.`;
|
|
894
|
-
}
|
|
895
|
-
default: return null;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
function formatVerificationSasNotice(summary) {
|
|
899
|
-
const sas = summary.sas;
|
|
900
|
-
if (!sas) return null;
|
|
901
|
-
const emojiLine = Array.isArray(sas.emoji) && sas.emoji.length > 0 ? `SAS emoji: ${sas.emoji.map(([emoji, name]) => `${normalizeNullableString(emoji) ?? "?"} ${normalizeNullableString(name) ?? "?"}`).join(" | ")}` : null;
|
|
902
|
-
const decimalLine = Array.isArray(sas.decimal) && sas.decimal.length === 3 ? `SAS decimal: ${sas.decimal.join(" ")}` : null;
|
|
903
|
-
if (!emojiLine && !decimalLine) return null;
|
|
904
|
-
const lines = [`Matrix verification SAS with ${summary.otherUserId}:`];
|
|
905
|
-
if (emojiLine) lines.push(emojiLine);
|
|
906
|
-
if (decimalLine) lines.push(decimalLine);
|
|
907
|
-
lines.push("If both sides match, choose 'They match' in your Matrix app.");
|
|
908
|
-
return lines.join("\n");
|
|
909
|
-
}
|
|
910
|
-
function resolveVerificationFlowCandidates(params) {
|
|
911
|
-
const { event, flowId } = params;
|
|
912
|
-
const content = event.content;
|
|
913
|
-
const candidates = /* @__PURE__ */ new Set();
|
|
914
|
-
const add = (value) => {
|
|
915
|
-
const normalized = normalizeNullableString(value);
|
|
916
|
-
if (normalized) candidates.add(normalized);
|
|
917
|
-
};
|
|
918
|
-
add(flowId);
|
|
919
|
-
add(event.event_id);
|
|
920
|
-
add(content.transaction_id);
|
|
921
|
-
add(content["m.relates_to"]?.event_id);
|
|
922
|
-
return Array.from(candidates);
|
|
923
|
-
}
|
|
924
|
-
function resolveSummaryRecency(summary) {
|
|
925
|
-
const ts = Date.parse(summary.updatedAt ?? "");
|
|
926
|
-
return Number.isFinite(ts) ? ts : 0;
|
|
927
|
-
}
|
|
928
|
-
function isActiveVerificationSummary(summary) {
|
|
929
|
-
if (summary.completed === true) return false;
|
|
930
|
-
if (summary.phaseName === "cancelled" || summary.phaseName === "done") return false;
|
|
931
|
-
if (typeof summary.phase === "number" && summary.phase >= 4) return false;
|
|
932
|
-
return true;
|
|
933
|
-
}
|
|
934
|
-
async function resolveVerificationSummaryForSignal(client, params) {
|
|
935
|
-
if (!client.crypto) return null;
|
|
936
|
-
await client.crypto.ensureVerificationDmTracked({
|
|
937
|
-
roomId: params.roomId,
|
|
938
|
-
userId: params.senderId
|
|
939
|
-
}).catch(() => null);
|
|
940
|
-
const list = await client.crypto.listVerifications();
|
|
941
|
-
if (list.length === 0) return null;
|
|
942
|
-
const candidates = resolveVerificationFlowCandidates({
|
|
943
|
-
event: params.event,
|
|
944
|
-
flowId: params.flowId
|
|
945
|
-
});
|
|
946
|
-
const byTransactionId = list.find((entry) => candidates.some((candidate) => entry.transactionId === candidate));
|
|
947
|
-
if (byTransactionId) return byTransactionId;
|
|
948
|
-
const { inspectMatrixDirectRooms, isStrictDirectRoom } = await loadMatrixDirectRoomDeps();
|
|
949
|
-
const inspection = await inspectMatrixDirectRooms({
|
|
950
|
-
client,
|
|
951
|
-
remoteUserId: params.senderId
|
|
952
|
-
}).catch(() => null);
|
|
953
|
-
const activeRoomId = normalizeNullableString(inspection?.activeRoomId);
|
|
954
|
-
if (activeRoomId) {
|
|
955
|
-
if (activeRoomId !== params.roomId) return null;
|
|
956
|
-
} else if (!await isStrictDirectRoom({
|
|
957
|
-
client,
|
|
958
|
-
roomId: params.roomId,
|
|
959
|
-
remoteUserId: params.senderId
|
|
960
|
-
})) return null;
|
|
961
|
-
const activeByUser = list.filter((entry) => entry.otherUserId === params.senderId && isActiveVerificationSummary(entry)).toSorted((a, b) => resolveSummaryRecency(b) - resolveSummaryRecency(a));
|
|
962
|
-
const activeInRoom = activeByUser.filter((entry) => {
|
|
963
|
-
return normalizeNullableString(entry.roomId) === params.roomId;
|
|
964
|
-
});
|
|
965
|
-
if (activeInRoom.length > 0) return activeInRoom[0] ?? null;
|
|
966
|
-
return activeByUser[0] ?? null;
|
|
967
|
-
}
|
|
968
|
-
async function resolveVerificationSasNoticeForSignal(client, params) {
|
|
969
|
-
const summary = await resolveVerificationSummaryForSignal(client, params);
|
|
970
|
-
const immediateNotice = summary && isActiveVerificationSummary(summary) ? formatVerificationSasNotice(summary) : null;
|
|
971
|
-
if (immediateNotice || params.stage !== "ready" && params.stage !== "start") return {
|
|
972
|
-
summary,
|
|
973
|
-
sasNotice: immediateNotice
|
|
974
|
-
};
|
|
975
|
-
await new Promise((resolve) => {
|
|
976
|
-
setTimeout(resolve, params.sasNoticeRetryDelayMs ?? SAS_NOTICE_RETRY_DELAY_MS);
|
|
977
|
-
});
|
|
978
|
-
const retriedSummary = await resolveVerificationSummaryForSignal(client, params);
|
|
979
|
-
return {
|
|
980
|
-
summary: retriedSummary,
|
|
981
|
-
sasNotice: retriedSummary && isActiveVerificationSummary(retriedSummary) ? formatVerificationSasNotice(retriedSummary) : null
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
function trackBounded(set, value) {
|
|
985
|
-
if (!value || set.has(value)) return false;
|
|
986
|
-
set.add(value);
|
|
987
|
-
if (set.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
988
|
-
const oldest = set.values().next().value;
|
|
989
|
-
if (typeof oldest === "string") set.delete(oldest);
|
|
990
|
-
}
|
|
991
|
-
return true;
|
|
992
|
-
}
|
|
993
|
-
async function sendVerificationNotice(params) {
|
|
994
|
-
const roomId = normalizeNullableString(params.roomId);
|
|
995
|
-
if (!roomId) return;
|
|
996
|
-
try {
|
|
997
|
-
await params.client.sendMessage(roomId, {
|
|
998
|
-
msgtype: "m.notice",
|
|
999
|
-
body: params.body
|
|
1000
|
-
});
|
|
1001
|
-
} catch (err) {
|
|
1002
|
-
params.logVerboseMessage(`matrix: failed sending verification notice room=${roomId}: ${String(err)}`);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
async function isVerificationNoticeAuthorized(params) {
|
|
1006
|
-
if (!params.dmEnabled || params.dmPolicy === "disabled") {
|
|
1007
|
-
params.logVerboseMessage(`matrix: blocked verification sender ${params.senderId} (dmPolicy=${params.dmPolicy}, dmEnabled=${String(params.dmEnabled)})`);
|
|
1008
|
-
return false;
|
|
1009
|
-
}
|
|
1010
|
-
const storeAllowFrom = params.dmPolicy !== "allowlist" && params.dmPolicy !== "open" ? await params.readStoreAllowFrom() : [];
|
|
1011
|
-
if ((await resolveMatrixMonitorAccessState({
|
|
1012
|
-
allowFrom: params.allowFrom,
|
|
1013
|
-
storeAllowFrom,
|
|
1014
|
-
dmPolicy: params.dmPolicy,
|
|
1015
|
-
groupPolicy: "open",
|
|
1016
|
-
groupAllowFrom: [],
|
|
1017
|
-
roomUsers: [],
|
|
1018
|
-
senderId: params.senderId,
|
|
1019
|
-
isRoom: false
|
|
1020
|
-
})).messageIngress.senderAccess.decision === "allow") return true;
|
|
1021
|
-
params.logVerboseMessage(`matrix: blocked verification sender ${params.senderId} (dmPolicy=${params.dmPolicy})`);
|
|
1022
|
-
return false;
|
|
1023
|
-
}
|
|
1024
|
-
function createMatrixVerificationEventRouter(params) {
|
|
1025
|
-
const routerStartedAtMs = Date.now();
|
|
1026
|
-
const routedVerificationEvents = /* @__PURE__ */ new Set();
|
|
1027
|
-
const routedVerificationSasFingerprints = /* @__PURE__ */ new Set();
|
|
1028
|
-
const routedVerificationStageNotices = /* @__PURE__ */ new Set();
|
|
1029
|
-
const verificationFlowRooms = /* @__PURE__ */ new Map();
|
|
1030
|
-
const verificationUserRooms = /* @__PURE__ */ new Map();
|
|
1031
|
-
async function resolveActiveDirectRoomId(remoteUserId) {
|
|
1032
|
-
const { inspectMatrixDirectRooms } = await loadMatrixDirectRoomDeps();
|
|
1033
|
-
const inspection = await inspectMatrixDirectRooms({
|
|
1034
|
-
client: params.client,
|
|
1035
|
-
remoteUserId
|
|
1036
|
-
}).catch(() => null);
|
|
1037
|
-
return normalizeNullableString(inspection?.activeRoomId);
|
|
1038
|
-
}
|
|
1039
|
-
function shouldEmitVerificationEventNotice(event) {
|
|
1040
|
-
const eventTs = typeof event.origin_server_ts === "number" && Number.isFinite(event.origin_server_ts) ? event.origin_server_ts : null;
|
|
1041
|
-
if (eventTs === null) return true;
|
|
1042
|
-
return eventTs >= routerStartedAtMs - VERIFICATION_EVENT_STARTUP_GRACE_MS;
|
|
1043
|
-
}
|
|
1044
|
-
function rememberVerificationRoom(roomId, event, flowId) {
|
|
1045
|
-
for (const candidate of resolveVerificationFlowCandidates({
|
|
1046
|
-
event,
|
|
1047
|
-
flowId
|
|
1048
|
-
})) {
|
|
1049
|
-
verificationFlowRooms.set(candidate, roomId);
|
|
1050
|
-
if (verificationFlowRooms.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
1051
|
-
const oldest = verificationFlowRooms.keys().next().value;
|
|
1052
|
-
if (typeof oldest === "string") verificationFlowRooms.delete(oldest);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
function rememberVerificationUserRoom(remoteUserId, roomId) {
|
|
1057
|
-
const normalizedUserId = normalizeNullableString(remoteUserId);
|
|
1058
|
-
const normalizedRoomId = normalizeNullableString(roomId);
|
|
1059
|
-
if (!normalizedUserId || !normalizedRoomId) return;
|
|
1060
|
-
verificationUserRooms.delete(normalizedUserId);
|
|
1061
|
-
verificationUserRooms.set(normalizedUserId, normalizedRoomId);
|
|
1062
|
-
if (verificationUserRooms.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
1063
|
-
const oldest = verificationUserRooms.keys().next().value;
|
|
1064
|
-
if (typeof oldest === "string") verificationUserRooms.delete(oldest);
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
async function resolveSummaryRoomId(summary) {
|
|
1068
|
-
const mappedRoomId = normalizeNullableString(summary.roomId) ?? normalizeNullableString(summary.transactionId ? verificationFlowRooms.get(summary.transactionId) : null) ?? normalizeNullableString(verificationFlowRooms.get(summary.id));
|
|
1069
|
-
if (mappedRoomId) return mappedRoomId;
|
|
1070
|
-
const remoteUserId = normalizeNullableString(summary.otherUserId);
|
|
1071
|
-
if (!remoteUserId) return null;
|
|
1072
|
-
const recentRoomId = normalizeNullableString(verificationUserRooms.get(remoteUserId));
|
|
1073
|
-
const activeRoomId = await resolveActiveDirectRoomId(remoteUserId);
|
|
1074
|
-
if (recentRoomId && activeRoomId && recentRoomId === activeRoomId) return recentRoomId;
|
|
1075
|
-
if (activeRoomId) return activeRoomId;
|
|
1076
|
-
if (recentRoomId && await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
1077
|
-
client: params.client,
|
|
1078
|
-
roomId: recentRoomId,
|
|
1079
|
-
remoteUserId
|
|
1080
|
-
})) return recentRoomId;
|
|
1081
|
-
return null;
|
|
1082
|
-
}
|
|
1083
|
-
async function routeVerificationSummary(summary) {
|
|
1084
|
-
const roomId = await resolveSummaryRoomId(summary);
|
|
1085
|
-
if (!roomId || !isActiveVerificationSummary(summary)) return;
|
|
1086
|
-
if (!await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
1087
|
-
client: params.client,
|
|
1088
|
-
roomId,
|
|
1089
|
-
remoteUserId: summary.otherUserId
|
|
1090
|
-
})) {
|
|
1091
|
-
params.logVerboseMessage(`matrix: ignoring verification summary outside strict DM room=${roomId} sender=${summary.otherUserId}`);
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
if (!await isVerificationNoticeAuthorized({
|
|
1095
|
-
senderId: summary.otherUserId,
|
|
1096
|
-
allowFrom: params.allowFrom,
|
|
1097
|
-
dmEnabled: params.dmEnabled,
|
|
1098
|
-
dmPolicy: params.dmPolicy,
|
|
1099
|
-
readStoreAllowFrom: params.readStoreAllowFrom,
|
|
1100
|
-
logVerboseMessage: params.logVerboseMessage
|
|
1101
|
-
})) return;
|
|
1102
|
-
const sasNotice = formatVerificationSasNotice(summary);
|
|
1103
|
-
if (!sasNotice) return;
|
|
1104
|
-
const sasFingerprint = `${summary.id}:${JSON.stringify(summary.sas)}`;
|
|
1105
|
-
if (!trackBounded(routedVerificationSasFingerprints, sasFingerprint)) return;
|
|
1106
|
-
await sendVerificationNotice({
|
|
1107
|
-
client: params.client,
|
|
1108
|
-
roomId,
|
|
1109
|
-
body: sasNotice,
|
|
1110
|
-
logVerboseMessage: params.logVerboseMessage
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
function routeVerificationEvent(roomId, event) {
|
|
1114
|
-
const senderId = normalizeNullableString(event?.sender);
|
|
1115
|
-
if (!senderId) return false;
|
|
1116
|
-
const signal = readVerificationSignal(event);
|
|
1117
|
-
if (!signal) return false;
|
|
1118
|
-
rememberVerificationRoom(roomId, event, signal.flowId);
|
|
1119
|
-
const routeTask = async () => {
|
|
1120
|
-
if (!shouldEmitVerificationEventNotice(event)) {
|
|
1121
|
-
params.logVerboseMessage(`matrix: ignoring historical verification event room=${roomId} id=${event.event_id ?? "unknown"} type=${event.type ?? "unknown"}`);
|
|
1122
|
-
return;
|
|
1123
|
-
}
|
|
1124
|
-
const flowId = signal.flowId;
|
|
1125
|
-
const sourceFingerprint = normalizeNullableString(event?.event_id) ?? `${senderId}:${event.type}:${flowId ?? "none"}`;
|
|
1126
|
-
if (!await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
1127
|
-
client: params.client,
|
|
1128
|
-
roomId,
|
|
1129
|
-
remoteUserId: senderId
|
|
1130
|
-
})) {
|
|
1131
|
-
params.logVerboseMessage(`matrix: ignoring verification event outside strict DM room=${roomId} sender=${senderId}`);
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
if (!await isVerificationNoticeAuthorized({
|
|
1135
|
-
senderId,
|
|
1136
|
-
allowFrom: params.allowFrom,
|
|
1137
|
-
dmEnabled: params.dmEnabled,
|
|
1138
|
-
dmPolicy: params.dmPolicy,
|
|
1139
|
-
readStoreAllowFrom: params.readStoreAllowFrom,
|
|
1140
|
-
logVerboseMessage: params.logVerboseMessage
|
|
1141
|
-
})) return;
|
|
1142
|
-
rememberVerificationUserRoom(senderId, roomId);
|
|
1143
|
-
if (!trackBounded(routedVerificationEvents, sourceFingerprint)) return;
|
|
1144
|
-
const stageNotice = formatVerificationStageNotice({
|
|
1145
|
-
stage: signal.stage,
|
|
1146
|
-
senderId,
|
|
1147
|
-
event
|
|
1148
|
-
});
|
|
1149
|
-
const { summary, sasNotice } = await resolveVerificationSasNoticeForSignal(params.client, {
|
|
1150
|
-
roomId,
|
|
1151
|
-
event,
|
|
1152
|
-
senderId,
|
|
1153
|
-
flowId,
|
|
1154
|
-
stage: signal.stage,
|
|
1155
|
-
sasNoticeRetryDelayMs: params.sasNoticeRetryDelayMs
|
|
1156
|
-
}).catch(() => ({
|
|
1157
|
-
summary: null,
|
|
1158
|
-
sasNotice: null
|
|
1159
|
-
}));
|
|
1160
|
-
const notices = [];
|
|
1161
|
-
if (stageNotice) {
|
|
1162
|
-
const stageKey = `${roomId}:${senderId}:${flowId ?? sourceFingerprint}:${signal.stage}`;
|
|
1163
|
-
if (trackBounded(routedVerificationStageNotices, stageKey)) notices.push(stageNotice);
|
|
1164
|
-
}
|
|
1165
|
-
if (summary && sasNotice) {
|
|
1166
|
-
const sasFingerprint = `${summary.id}:${JSON.stringify(summary.sas)}`;
|
|
1167
|
-
if (trackBounded(routedVerificationSasFingerprints, sasFingerprint)) notices.push(sasNotice);
|
|
1168
|
-
}
|
|
1169
|
-
if (notices.length === 0) return;
|
|
1170
|
-
for (const body of notices) await sendVerificationNotice({
|
|
1171
|
-
client: params.client,
|
|
1172
|
-
roomId,
|
|
1173
|
-
body,
|
|
1174
|
-
logVerboseMessage: params.logVerboseMessage
|
|
1175
|
-
});
|
|
1176
|
-
};
|
|
1177
|
-
if (params.runDetachedTask) params.runDetachedTask(`verification event handler room=${roomId} id=${event.event_id ?? "unknown"}`, routeTask);
|
|
1178
|
-
else routeTask().catch((err) => {
|
|
1179
|
-
params.logVerboseMessage(`matrix: failed routing verification event: ${String(err)}`);
|
|
1180
|
-
});
|
|
1181
|
-
return true;
|
|
1182
|
-
}
|
|
1183
|
-
return {
|
|
1184
|
-
routeVerificationEvent,
|
|
1185
|
-
routeVerificationSummary
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
//#endregion
|
|
1189
|
-
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1190
|
-
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS = 12e4;
|
|
1191
|
-
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD = 3;
|
|
1192
|
-
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT = 3;
|
|
1193
|
-
function formatMatrixPostHealthySyncDecryptionHint(accountId) {
|
|
1194
|
-
return `matrix: repeated fresh encrypted messages are still failing to decrypt after Matrix resumed healthy sync. This device may still be missing new room keys. Check 'openclaw matrix verify status --verbose --account ${accountId}' and 'openclaw matrix devices list --account ${accountId}'.`;
|
|
1195
|
-
}
|
|
1196
|
-
function isFreshPostHealthySyncDecryptFailure(params) {
|
|
1197
|
-
const { event, healthySyncSinceMs, graceMs = 0, nowMs } = params;
|
|
1198
|
-
if (typeof healthySyncSinceMs !== "number" || !Number.isFinite(healthySyncSinceMs)) return false;
|
|
1199
|
-
const eventTs = event.origin_server_ts;
|
|
1200
|
-
if (!Number.isFinite(eventTs) || eventTs <= 0) return false;
|
|
1201
|
-
if (eventTs < healthySyncSinceMs + graceMs) return false;
|
|
1202
|
-
if (eventTs > nowMs + 6e4) return false;
|
|
1203
|
-
return true;
|
|
1204
|
-
}
|
|
1205
|
-
function createMatrixPostHealthySyncDecryptFailureTracker(params) {
|
|
1206
|
-
let observations = [];
|
|
1207
|
-
let warningEmitted = false;
|
|
1208
|
-
let trackedHealthySyncSinceMs;
|
|
1209
|
-
const resetObservations = () => {
|
|
1210
|
-
observations = [];
|
|
1211
|
-
warningEmitted = false;
|
|
1212
|
-
};
|
|
1213
|
-
const pruneObservations = (nowMs) => {
|
|
1214
|
-
observations = observations.filter((entry) => nowMs - entry.eventTs <= MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS);
|
|
1215
|
-
if (observations.length === 0) warningEmitted = false;
|
|
1216
|
-
};
|
|
1217
|
-
return { recordFailure(roomId, event, error) {
|
|
1218
|
-
const nowMs = Date.now();
|
|
1219
|
-
const healthySyncSinceMs = params.getHealthySyncSinceMs?.();
|
|
1220
|
-
if (healthySyncSinceMs !== trackedHealthySyncSinceMs) {
|
|
1221
|
-
trackedHealthySyncSinceMs = healthySyncSinceMs;
|
|
1222
|
-
resetObservations();
|
|
1223
|
-
}
|
|
1224
|
-
if (!isFreshPostHealthySyncDecryptFailure({
|
|
1225
|
-
event,
|
|
1226
|
-
healthySyncSinceMs,
|
|
1227
|
-
graceMs: params.startupGraceMs,
|
|
1228
|
-
nowMs
|
|
1229
|
-
})) return {
|
|
1230
|
-
freshAfterHealthySync: false,
|
|
1231
|
-
failureCount: 0
|
|
1232
|
-
};
|
|
1233
|
-
pruneObservations(nowMs);
|
|
1234
|
-
const key = `${roomId}|${event.event_id}`;
|
|
1235
|
-
if (!observations.some((entry) => entry.key === key)) observations.push({
|
|
1236
|
-
key,
|
|
1237
|
-
roomId,
|
|
1238
|
-
eventId: event.event_id,
|
|
1239
|
-
sender: typeof event.sender === "string" ? event.sender : null,
|
|
1240
|
-
eventTs: event.origin_server_ts,
|
|
1241
|
-
error: error.message
|
|
1242
|
-
});
|
|
1243
|
-
const failureCount = observations.length;
|
|
1244
|
-
if (warningEmitted || failureCount < MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD) return {
|
|
1245
|
-
freshAfterHealthySync: true,
|
|
1246
|
-
failureCount
|
|
1247
|
-
};
|
|
1248
|
-
warningEmitted = true;
|
|
1249
|
-
const rooms = uniqueStrings(observations.map((entry) => entry.roomId)).slice(0, MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT);
|
|
1250
|
-
const senders = uniqueStrings(observations.map((entry) => entry.sender).filter((sender) => Boolean(sender))).slice(0, MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT);
|
|
1251
|
-
const eventIds = observations.slice(-3).map((entry) => entry.eventId);
|
|
1252
|
-
const latestError = observations.at(-1)?.error ?? error.message;
|
|
1253
|
-
return {
|
|
1254
|
-
freshAfterHealthySync: true,
|
|
1255
|
-
failureCount,
|
|
1256
|
-
warning: {
|
|
1257
|
-
rooms,
|
|
1258
|
-
roomCount: new Set(observations.map((entry) => entry.roomId)).size,
|
|
1259
|
-
senders,
|
|
1260
|
-
senderCount: new Set(observations.map((entry) => entry.sender).filter(Boolean)).size,
|
|
1261
|
-
eventIds,
|
|
1262
|
-
latestError,
|
|
1263
|
-
windowMs: MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS
|
|
1264
|
-
}
|
|
1265
|
-
};
|
|
1266
|
-
} };
|
|
1267
|
-
}
|
|
1268
|
-
function formatMatrixSelfDecryptionHint(accountId) {
|
|
1269
|
-
return `matrix: failed to decrypt a message from this same Matrix user. This usually means another Matrix device did not share the room key, or another OpenClaw runtime is using the same account. Check 'openclaw matrix verify status --verbose --account ${accountId}' and 'openclaw matrix devices list --account ${accountId}'.`;
|
|
1270
|
-
}
|
|
1271
|
-
async function resolveMatrixSelfUserId(client, logVerboseMessage) {
|
|
1272
|
-
if (typeof client.getUserId !== "function") return null;
|
|
1273
|
-
try {
|
|
1274
|
-
return await client.getUserId() ?? null;
|
|
1275
|
-
} catch (err) {
|
|
1276
|
-
logVerboseMessage(`matrix: failed resolving self user id for decrypt warning: ${String(err)}`);
|
|
1277
|
-
return null;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
function registerMatrixMonitorEvents(params) {
|
|
1281
|
-
const { cfg, client, auth, allowFrom, dmEnabled, dmPolicy, readStoreAllowFrom, directTracker, invalidateMemberDisplayName, logVerboseMessage, warnedEncryptedRooms, warnedCryptoMissingRooms, logger, startupGraceMs, getHealthySyncSinceMs, formatNativeDependencyHint, onRoomMessage, runDetachedTask, sasNoticeRetryDelayMs } = params;
|
|
1282
|
-
const postHealthySyncDecryptFailureTracker = createMatrixPostHealthySyncDecryptFailureTracker({
|
|
1283
|
-
getHealthySyncSinceMs,
|
|
1284
|
-
startupGraceMs
|
|
1285
|
-
});
|
|
1286
|
-
const { routeVerificationEvent, routeVerificationSummary } = createMatrixVerificationEventRouter({
|
|
1287
|
-
client,
|
|
1288
|
-
allowFrom,
|
|
1289
|
-
dmEnabled,
|
|
1290
|
-
dmPolicy,
|
|
1291
|
-
readStoreAllowFrom,
|
|
1292
|
-
logVerboseMessage,
|
|
1293
|
-
runDetachedTask,
|
|
1294
|
-
sasNoticeRetryDelayMs
|
|
1295
|
-
});
|
|
1296
|
-
const runMonitorTask = (label, task) => {
|
|
1297
|
-
if (runDetachedTask) return runDetachedTask(label, task);
|
|
1298
|
-
return Promise.resolve().then(task).catch((error) => {
|
|
1299
|
-
logVerboseMessage(`matrix: ${label} failed (${String(error)})`);
|
|
1300
|
-
});
|
|
1301
|
-
};
|
|
1302
|
-
const onRoomMessageEvent = (roomId, event) => {
|
|
1303
|
-
if (routeVerificationEvent(roomId, event)) return;
|
|
1304
|
-
runMonitorTask(`room message handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1305
|
-
await onRoomMessage(roomId, event);
|
|
1306
|
-
});
|
|
1307
|
-
};
|
|
1308
|
-
const onEncryptedEvent = (roomId, event) => {
|
|
1309
|
-
const eventId = event?.event_id ?? "unknown";
|
|
1310
|
-
const eventType = event?.type ?? "unknown";
|
|
1311
|
-
logVerboseMessage(`matrix: encrypted event room=${roomId} type=${eventType} id=${eventId}`);
|
|
1312
|
-
};
|
|
1313
|
-
const onDecryptedEvent = (roomId, event) => {
|
|
1314
|
-
const eventId = event?.event_id ?? "unknown";
|
|
1315
|
-
const eventType = event?.type ?? "unknown";
|
|
1316
|
-
logVerboseMessage(`matrix: decrypted event room=${roomId} type=${eventType} id=${eventId}`);
|
|
1317
|
-
if (routeVerificationEvent(roomId, event)) return;
|
|
1318
|
-
if (eventType !== EventType.RoomMessage) return;
|
|
1319
|
-
runMonitorTask(`decrypted room message handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1320
|
-
await onRoomMessage(roomId, event);
|
|
1321
|
-
});
|
|
1322
|
-
};
|
|
1323
|
-
const onFailedDecryption = (roomId, event, error) => {
|
|
1324
|
-
runMonitorTask(`failed decryption handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1325
|
-
const failureState = postHealthySyncDecryptFailureTracker.recordFailure(roomId, event, error);
|
|
1326
|
-
const selfUserId = await resolveMatrixSelfUserId(client, logVerboseMessage);
|
|
1327
|
-
const sender = typeof event.sender === "string" ? event.sender : null;
|
|
1328
|
-
const senderMatchesOwnUser = Boolean(selfUserId && sender && selfUserId === sender);
|
|
1329
|
-
logger.warn(failureState.freshAfterHealthySync ? "Failed to decrypt fresh post-healthy-sync message" : "Failed to decrypt message", {
|
|
1330
|
-
roomId,
|
|
1331
|
-
eventId: event.event_id,
|
|
1332
|
-
sender,
|
|
1333
|
-
senderMatchesOwnUser,
|
|
1334
|
-
error: error.message,
|
|
1335
|
-
freshAfterHealthySync: failureState.freshAfterHealthySync,
|
|
1336
|
-
...failureState.freshAfterHealthySync ? { postHealthySyncFailureCount: failureState.failureCount } : {}
|
|
1337
|
-
});
|
|
1338
|
-
if (failureState.warning) logger.warn(formatMatrixPostHealthySyncDecryptionHint(auth.accountId), {
|
|
1339
|
-
roomId,
|
|
1340
|
-
eventId: event.event_id,
|
|
1341
|
-
failureCount: failureState.failureCount,
|
|
1342
|
-
roomCount: failureState.warning.roomCount,
|
|
1343
|
-
rooms: failureState.warning.rooms,
|
|
1344
|
-
senderCount: failureState.warning.senderCount,
|
|
1345
|
-
senders: failureState.warning.senders,
|
|
1346
|
-
sampleEventIds: failureState.warning.eventIds,
|
|
1347
|
-
latestError: failureState.warning.latestError,
|
|
1348
|
-
windowMs: failureState.warning.windowMs
|
|
1349
|
-
});
|
|
1350
|
-
if (senderMatchesOwnUser) logger.warn(formatMatrixSelfDecryptionHint(auth.accountId), {
|
|
1351
|
-
roomId,
|
|
1352
|
-
eventId: event.event_id,
|
|
1353
|
-
sender
|
|
1354
|
-
});
|
|
1355
|
-
logVerboseMessage(`matrix: failed decrypt room=${roomId} id=${event.event_id ?? "unknown"} freshAfterHealthySync=${String(failureState.freshAfterHealthySync)} error=${error.message}`);
|
|
1356
|
-
});
|
|
1357
|
-
};
|
|
1358
|
-
const onVerificationSummary = (summary) => {
|
|
1359
|
-
runMonitorTask("verification summary handler", async () => {
|
|
1360
|
-
await routeVerificationSummary(summary);
|
|
1361
|
-
});
|
|
1362
|
-
};
|
|
1363
|
-
const onInvite = (roomId, event) => {
|
|
1364
|
-
directTracker?.invalidateRoom(roomId);
|
|
1365
|
-
const eventId = event?.event_id ?? "unknown";
|
|
1366
|
-
const sender = event?.sender ?? "unknown";
|
|
1367
|
-
const invitee = normalizeOptionalString(event?.state_key) ?? "";
|
|
1368
|
-
const senderIsInvitee = Boolean(invitee) && (normalizeOptionalString(event?.sender) ?? "") === invitee;
|
|
1369
|
-
const isDirect = (event?.content)?.is_direct === true;
|
|
1370
|
-
const rememberedSender = normalizeOptionalString(event?.sender);
|
|
1371
|
-
if (rememberedSender && !senderIsInvitee) directTracker?.rememberInvite?.(roomId, rememberedSender);
|
|
1372
|
-
logVerboseMessage(`matrix: invite room=${roomId} sender=${sender} direct=${String(isDirect)} id=${eventId}`);
|
|
1373
|
-
};
|
|
1374
|
-
const onJoin = (roomId, event) => {
|
|
1375
|
-
directTracker?.invalidateRoom(roomId);
|
|
1376
|
-
const eventId = event?.event_id ?? "unknown";
|
|
1377
|
-
logVerboseMessage(`matrix: join room=${roomId} id=${eventId}`);
|
|
1378
|
-
if (event.membershipProvenance !== "transition" || event.state_key !== auth.userId) return;
|
|
1379
|
-
runMonitorTask(`join introduction room=${roomId}`, async () => {
|
|
1380
|
-
const members = await readJoinedMatrixMembers(client, roomId);
|
|
1381
|
-
const remoteUserId = members?.find((member) => member !== auth.userId);
|
|
1382
|
-
if (!members?.includes(auth.userId) || !remoteUserId || await directTracker.isDirectMessage({
|
|
1383
|
-
roomId,
|
|
1384
|
-
senderId: remoteUserId,
|
|
1385
|
-
selfUserId: auth.userId,
|
|
1386
|
-
joinedMembers: members
|
|
1387
|
-
})) return;
|
|
1388
|
-
const roomInfo = await params.getRoomInfo(roomId, { includeAliases: params.needsRoomAliasesForConfig });
|
|
1389
|
-
const roomConfig = resolveMatrixRoomConfig({
|
|
1390
|
-
rooms: params.roomsConfig,
|
|
1391
|
-
roomId,
|
|
1392
|
-
aliases: [roomInfo.canonicalAlias ?? "", ...roomInfo.altAliases].filter(Boolean)
|
|
1393
|
-
});
|
|
1394
|
-
const roomAllowed = (!params.needsRoomAliasesForConfig || roomInfo.aliasesResolved) && params.groupPolicy !== "disabled" && (roomConfig.config ? roomConfig.allowed : params.groupPolicy === "open");
|
|
1395
|
-
const options = {
|
|
1396
|
-
cfg,
|
|
1397
|
-
accountId: auth.accountId,
|
|
1398
|
-
client
|
|
1399
|
-
};
|
|
1400
|
-
await reportChannelRoomJoin({
|
|
1401
|
-
cfg,
|
|
1402
|
-
channel: "matrix",
|
|
1403
|
-
accountId: auth.accountId,
|
|
1404
|
-
conversationId: roomId,
|
|
1405
|
-
deliverTo: `room:${roomId}`,
|
|
1406
|
-
route: resolveMatrixInboundRoute({
|
|
1407
|
-
cfg,
|
|
1408
|
-
accountId: auth.accountId,
|
|
1409
|
-
roomId,
|
|
1410
|
-
senderId: auth.userId,
|
|
1411
|
-
isDirectMessage: false,
|
|
1412
|
-
resolveAgentRoute
|
|
1413
|
-
}).route,
|
|
1414
|
-
roomAllowed,
|
|
1415
|
-
resolveRoomContext: async ({ messageLimit }) => {
|
|
1416
|
-
const info = await getMatrixRoomInfo(roomId, options);
|
|
1417
|
-
const context = {
|
|
1418
|
-
title: info.name ?? void 0,
|
|
1419
|
-
purpose: info.topic ?? void 0
|
|
1420
|
-
};
|
|
1421
|
-
try {
|
|
1422
|
-
const { messages } = await readMatrixMessages(roomId, {
|
|
1423
|
-
...options,
|
|
1424
|
-
limit: messageLimit
|
|
1425
|
-
});
|
|
1426
|
-
return {
|
|
1427
|
-
...context,
|
|
1428
|
-
recentMessages: messages.toReversed().flatMap(({ sender, body }) => body?.trim() ? [{
|
|
1429
|
-
sender,
|
|
1430
|
-
text: body
|
|
1431
|
-
}] : [])
|
|
1432
|
-
};
|
|
1433
|
-
} catch {
|
|
1434
|
-
return context;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
});
|
|
1438
|
-
});
|
|
1439
|
-
};
|
|
1440
|
-
const onRoomEvent = (roomId, event) => {
|
|
1441
|
-
const eventType = event?.type ?? "unknown";
|
|
1442
|
-
if (eventType === EventType.RoomMessageEncrypted) {
|
|
1443
|
-
logVerboseMessage(`matrix: encrypted raw event room=${roomId} id=${event?.event_id ?? "unknown"}`);
|
|
1444
|
-
if (auth.encryption !== true && !warnedEncryptedRooms.has(roomId)) {
|
|
1445
|
-
warnedEncryptedRooms.add(roomId);
|
|
1446
|
-
const warning = formatMatrixEncryptedEventDisabledWarning(cfg, auth.accountId);
|
|
1447
|
-
logger.warn(warning, { roomId });
|
|
1448
|
-
}
|
|
1449
|
-
if (auth.encryption === true && !client.crypto && !warnedCryptoMissingRooms.has(roomId)) {
|
|
1450
|
-
warnedCryptoMissingRooms.add(roomId);
|
|
1451
|
-
const warning = `matrix: encryption enabled but crypto is unavailable; ${formatNativeDependencyHint({
|
|
1452
|
-
packageName: "@matrix-org/matrix-sdk-crypto-nodejs",
|
|
1453
|
-
manager: "pnpm",
|
|
1454
|
-
downloadCommand: "node node_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js"
|
|
1455
|
-
})}`;
|
|
1456
|
-
logger.warn(warning, { roomId });
|
|
1457
|
-
}
|
|
1458
|
-
return;
|
|
1459
|
-
}
|
|
1460
|
-
if (eventType === EventType.RoomMember) {
|
|
1461
|
-
directTracker?.invalidateRoom(roomId);
|
|
1462
|
-
const membership = (event?.content)?.membership;
|
|
1463
|
-
const stateKey = event.state_key ?? "";
|
|
1464
|
-
if (stateKey) invalidateMemberDisplayName?.(roomId, stateKey);
|
|
1465
|
-
logVerboseMessage(`matrix: member event room=${roomId} stateKey=${stateKey} membership=${membership ?? "unknown"}`);
|
|
1466
|
-
}
|
|
1467
|
-
if (eventType === EventType.Reaction) {
|
|
1468
|
-
runMonitorTask(`reaction handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1469
|
-
await onRoomMessage(roomId, event);
|
|
1470
|
-
});
|
|
1471
|
-
return;
|
|
1472
|
-
}
|
|
1473
|
-
routeVerificationEvent(roomId, event);
|
|
1474
|
-
};
|
|
1475
|
-
client.on("room.message", onRoomMessageEvent);
|
|
1476
|
-
client.on("room.encrypted_event", onEncryptedEvent);
|
|
1477
|
-
client.on("room.decrypted_event", onDecryptedEvent);
|
|
1478
|
-
client.on("room.failed_decryption", onFailedDecryption);
|
|
1479
|
-
client.on("verification.summary", onVerificationSummary);
|
|
1480
|
-
client.on("room.invite", onInvite);
|
|
1481
|
-
client.on("room.join", onJoin);
|
|
1482
|
-
client.on("room.event", onRoomEvent);
|
|
1483
|
-
return () => {
|
|
1484
|
-
client.off("room.message", onRoomMessageEvent);
|
|
1485
|
-
client.off("room.encrypted_event", onEncryptedEvent);
|
|
1486
|
-
client.off("room.decrypted_event", onDecryptedEvent);
|
|
1487
|
-
client.off("room.failed_decryption", onFailedDecryption);
|
|
1488
|
-
client.off("verification.summary", onVerificationSummary);
|
|
1489
|
-
client.off("room.invite", onInvite);
|
|
1490
|
-
client.off("room.join", onJoin);
|
|
1491
|
-
client.off("room.event", onRoomEvent);
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
//#endregion
|
|
1495
|
-
//#region extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1496
|
-
function resolveMatrixAckReactionConfig(params) {
|
|
1497
|
-
const matrixConfig = params.cfg.channels?.matrix;
|
|
1498
|
-
const accountConfig = resolveMatrixAccountConfig({
|
|
1499
|
-
cfg: params.cfg,
|
|
1500
|
-
accountId: params.accountId
|
|
1501
|
-
});
|
|
1502
|
-
return {
|
|
1503
|
-
ackReaction: resolveAckReaction(params.cfg, params.agentId, {
|
|
1504
|
-
channel: "matrix",
|
|
1505
|
-
accountId: params.accountId ?? void 0
|
|
1506
|
-
}).trim(),
|
|
1507
|
-
ackReactionScope: accountConfig.ackReactionScope ?? matrixConfig?.ackReactionScope ?? params.cfg.messages?.ackReactionScope ?? "group-mentions"
|
|
1508
|
-
};
|
|
1509
|
-
}
|
|
1510
|
-
//#endregion
|
|
1511
|
-
//#region extensions/matrix/src/matrix/monitor/preflight-audio.ts
|
|
1512
|
-
function isMatrixAudioContent(params) {
|
|
1513
|
-
if (params.msgtype === "m.audio") return true;
|
|
1514
|
-
if (params.msgtype === "m.file" && typeof params.mimetype === "string") return params.mimetype.toLowerCase().startsWith("audio/");
|
|
1515
|
-
return false;
|
|
1516
|
-
}
|
|
1517
|
-
const matrixPreflightAudio = createChannelPreflightAudio({
|
|
1518
|
-
channel: "matrix",
|
|
1519
|
-
isAudio: isMatrixAudioContent
|
|
1520
|
-
});
|
|
1521
|
-
async function resolveMatrixPreflightAudioTranscript(params) {
|
|
1522
|
-
return await matrixPreflightAudio.resolve({
|
|
1523
|
-
request: {
|
|
1524
|
-
ctx: {
|
|
1525
|
-
media: [{
|
|
1526
|
-
path: params.mediaPath,
|
|
1527
|
-
contentType: params.mediaContentType
|
|
1528
|
-
}],
|
|
1529
|
-
Provider: "matrix",
|
|
1530
|
-
Surface: "matrix",
|
|
1531
|
-
OriginatingChannel: "matrix",
|
|
1532
|
-
OriginatingTo: params.originatingTo,
|
|
1533
|
-
AccountId: params.accountId,
|
|
1534
|
-
MessageThreadId: params.messageThreadId,
|
|
1535
|
-
ChatType: params.chatType,
|
|
1536
|
-
SessionKey: params.sessionKey
|
|
1537
|
-
},
|
|
1538
|
-
cfg: params.cfg
|
|
1539
|
-
},
|
|
1540
|
-
abortSignal: params.abortSignal
|
|
1541
|
-
});
|
|
1542
|
-
}
|
|
1543
|
-
async function sendMatrixPreflightAudioTranscriptEcho(params) {
|
|
1544
|
-
await matrixPreflightAudio.send(params);
|
|
1545
|
-
}
|
|
1546
|
-
//#endregion
|
|
1547
|
-
//#region extensions/matrix/src/matrix/monitor/handler-helpers.ts
|
|
1548
|
-
const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
|
|
1549
|
-
const MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES = 512;
|
|
1550
|
-
function resolveMatrixMentionPrecheckText(params) {
|
|
1551
|
-
if (params.locationText?.trim()) return params.locationText.trim();
|
|
1552
|
-
if (typeof params.content.body === "string" && params.content.body.trim()) return params.content.body.trim();
|
|
1553
|
-
if (isPollStartType(params.eventType)) {
|
|
1554
|
-
const parsed = parsePollStartContent(params.content);
|
|
1555
|
-
if (parsed) return formatPollAsText(parsed);
|
|
1556
|
-
}
|
|
1557
|
-
return "";
|
|
1558
|
-
}
|
|
1559
|
-
function hasBundledMatrixReplacementRelation(event) {
|
|
1560
|
-
const relations = event.unsigned?.["m.relations"];
|
|
1561
|
-
if (!relations || typeof relations !== "object") return false;
|
|
1562
|
-
return relations[RelationType.Replace] !== void 0;
|
|
1563
|
-
}
|
|
1564
|
-
function resolveMatrixInboundBodyText(params) {
|
|
1565
|
-
if (params.mediaPlaceholder) return params.rawBody || params.mediaPlaceholder;
|
|
1566
|
-
if (!params.mediaDownloadFailed || !params.hadMediaUrl) return params.rawBody;
|
|
1567
|
-
if (params.mediaSizeLimitExceeded) return formatMatrixMediaTooLargeText({
|
|
1568
|
-
body: params.rawBody,
|
|
1569
|
-
filename: params.filename,
|
|
1570
|
-
msgtype: params.msgtype
|
|
1571
|
-
});
|
|
1572
|
-
return formatMatrixMediaUnavailableText({
|
|
1573
|
-
body: params.rawBody,
|
|
1574
|
-
filename: params.filename,
|
|
1575
|
-
msgtype: params.msgtype
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
function markTrackedRoomIfFirst(set, roomId) {
|
|
1579
|
-
if (set.has(roomId)) return false;
|
|
1580
|
-
set.add(roomId);
|
|
1581
|
-
if (set.size > MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES) {
|
|
1582
|
-
const oldest = set.keys().next().value;
|
|
1583
|
-
if (typeof oldest === "string") set.delete(oldest);
|
|
1584
|
-
}
|
|
1585
|
-
return true;
|
|
1586
|
-
}
|
|
1587
|
-
function resolveMatrixSharedDmContextNotice(params) {
|
|
1588
|
-
if ((params.dmSessionScope ?? "per-user") === "per-room") return null;
|
|
1589
|
-
if (params.sentRooms.has(params.roomId)) return null;
|
|
1590
|
-
try {
|
|
1591
|
-
const currentSession = resolveMatrixStoredSessionMeta(getSessionEntry({
|
|
1592
|
-
storePath: params.storePath,
|
|
1593
|
-
sessionKey: params.sessionKey
|
|
1594
|
-
}));
|
|
1595
|
-
if (!currentSession) return null;
|
|
1596
|
-
if (currentSession.channel && currentSession.channel !== "matrix") return null;
|
|
1597
|
-
if (currentSession.accountId && currentSession.accountId !== params.accountId) return null;
|
|
1598
|
-
if (!currentSession.directUserId) return null;
|
|
1599
|
-
if (!currentSession.roomId || currentSession.roomId === params.roomId) return null;
|
|
1600
|
-
return ["This Matrix DM is sharing a session with another Matrix DM room.", "Set channels.matrix.dm.sessionScope to per-room to isolate each Matrix DM room."].join(" ");
|
|
1601
|
-
} catch (err) {
|
|
1602
|
-
params.logVerboseMessage(`matrix: failed checking shared DM session notice room=${params.roomId} (${String(err)})`);
|
|
1603
|
-
return null;
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
function resolveMatrixPendingHistoryText(params) {
|
|
1607
|
-
if (!params.mediaUrl) return params.mentionPrecheckText;
|
|
1608
|
-
const body = typeof params.content.body === "string" ? params.content.body : void 0;
|
|
1609
|
-
const filename = typeof params.content.filename === "string" ? params.content.filename : void 0;
|
|
1610
|
-
const msgtype = typeof params.content.msgtype === "string" ? params.content.msgtype : void 0;
|
|
1611
|
-
return formatMatrixMessageText({
|
|
1612
|
-
body,
|
|
1613
|
-
filename,
|
|
1614
|
-
msgtype
|
|
1615
|
-
}) ?? params.mentionPrecheckText;
|
|
1616
|
-
}
|
|
1617
|
-
function resolveMatrixInboundMediaContent(content) {
|
|
1618
|
-
const file = content.file && typeof content.file === "object" ? content.file : void 0;
|
|
1619
|
-
const info = content.info && typeof content.info === "object" ? content.info : void 0;
|
|
1620
|
-
const body = normalizeOptionalString(content.body);
|
|
1621
|
-
return {
|
|
1622
|
-
url: normalizeOptionalString(content.url) ?? normalizeOptionalString(file?.url),
|
|
1623
|
-
file,
|
|
1624
|
-
body: body ?? "",
|
|
1625
|
-
contentType: info?.mimetype,
|
|
1626
|
-
sizeBytes: typeof info?.size === "number" ? info.size : void 0,
|
|
1627
|
-
originalFilename: normalizeOptionalString(content.filename) ?? body
|
|
1628
|
-
};
|
|
1629
|
-
}
|
|
1630
|
-
function isMatrixAudioMediaEnabled(cfg) {
|
|
1631
|
-
return cfg.tools?.media?.audio?.enabled !== false;
|
|
1632
|
-
}
|
|
1633
|
-
function shouldDeferMatrixAudioPreflightForRoomIngress(params) {
|
|
1634
|
-
if (!isMatrixAudioMediaEnabled(params.cfg)) return false;
|
|
1635
|
-
const mediaContent = resolveMatrixInboundMediaContent(params.content);
|
|
1636
|
-
return mediaContent.url?.startsWith("mxc://") === true && isMatrixAudioContent({
|
|
1637
|
-
msgtype: typeof params.content.msgtype === "string" ? params.content.msgtype : void 0,
|
|
1638
|
-
mimetype: mediaContent.contentType
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
function resolveMatrixAllowBotsMode(value) {
|
|
1642
|
-
if (value === true) return "all";
|
|
1643
|
-
if (value === "mentions") return "mentions";
|
|
1644
|
-
return "off";
|
|
1645
|
-
}
|
|
1646
|
-
function formatMatrixToolProgressMarkdownCode(text) {
|
|
1647
|
-
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, 299).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
1648
|
-
}
|
|
1649
|
-
//#endregion
|
|
1650
|
-
//#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
1651
|
-
function buildMatrixFinalizedPreviewContent() {
|
|
1652
|
-
return { [MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY]: true };
|
|
1653
|
-
}
|
|
1654
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-aVdC5NJO.mjs").then((n) => n.s));
|
|
1655
|
-
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1656
|
-
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1657
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-BvZmhjLC.mjs"));
|
|
1658
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-y0Vq5f38.mjs"));
|
|
1659
|
-
async function matrixTextWouldActivateMentions(client, text) {
|
|
1660
|
-
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1661
|
-
const mentions = await resolveMatrixMentionsForBody({
|
|
1662
|
-
client,
|
|
1663
|
-
body: text
|
|
1664
|
-
});
|
|
1665
|
-
return mentions.room === true || (mentions.user_ids?.length ?? 0) > 0;
|
|
1666
|
-
}
|
|
1667
|
-
//#endregion
|
|
1668
|
-
//#region extensions/matrix/src/matrix/monitor/context-summary.ts
|
|
1669
|
-
const MAX_CONTEXT_BODY_LENGTH = 500;
|
|
1670
|
-
function truncateMatrixContextBody(value) {
|
|
1671
|
-
if (value.length <= MAX_CONTEXT_BODY_LENGTH) return value;
|
|
1672
|
-
return `${sliceUtf16Safe(value, 0, 497)}...`;
|
|
1673
|
-
}
|
|
1674
|
-
function summarizeMatrixMessageContextEvent(event) {
|
|
1675
|
-
if (isPollStartType(event.type)) {
|
|
1676
|
-
const pollSummary = parsePollStartContent(event.content);
|
|
1677
|
-
if (pollSummary) return formatPollAsText(pollSummary);
|
|
1678
|
-
}
|
|
1679
|
-
const content = resolveMatrixReplacementContent(event) ?? event.content;
|
|
1680
|
-
return formatMatrixMessageText({
|
|
1681
|
-
body: readStringValue(content.body),
|
|
1682
|
-
filename: readStringValue(content.filename),
|
|
1683
|
-
msgtype: normalizeOptionalString(content.msgtype)
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
//#endregion
|
|
1687
|
-
//#region extensions/matrix/src/matrix/monitor/reply-context.ts
|
|
1688
|
-
const MAX_CACHED_REPLY_CONTEXTS = 256;
|
|
1689
|
-
function summarizeMatrixReplyEvent(event) {
|
|
1690
|
-
const body = summarizeMatrixMessageContextEvent(event);
|
|
1691
|
-
return body ? truncateMatrixContextBody(body) : void 0;
|
|
1692
|
-
}
|
|
1693
|
-
/**
|
|
1694
|
-
* Creates a cached resolver that fetches the body and sender of a replied-to
|
|
1695
|
-
* Matrix event. This allows the agent to see the content of the message being
|
|
1696
|
-
* replied to, not just its event ID.
|
|
1697
|
-
*/
|
|
1698
|
-
function createMatrixReplyContextResolver(params) {
|
|
1699
|
-
const cache = /* @__PURE__ */ new Map();
|
|
1700
|
-
const remember = (key, value) => {
|
|
1701
|
-
setBoundedMap(cache, key, value, MAX_CACHED_REPLY_CONTEXTS);
|
|
1702
|
-
return value;
|
|
1703
|
-
};
|
|
1704
|
-
return async (input) => {
|
|
1705
|
-
const cacheKey = `${input.roomId}:${input.eventId}`;
|
|
1706
|
-
const cached = cache.get(cacheKey);
|
|
1707
|
-
if (cached) {
|
|
1708
|
-
cache.delete(cacheKey);
|
|
1709
|
-
cache.set(cacheKey, cached);
|
|
1710
|
-
return cached;
|
|
1711
|
-
}
|
|
1712
|
-
const event = await params.client.getEvent(input.roomId, input.eventId).catch((err) => {
|
|
1713
|
-
params.logVerboseMessage(`matrix: failed resolving reply context room=${input.roomId} id=${input.eventId}: ${String(err)}`);
|
|
1714
|
-
return null;
|
|
1715
|
-
});
|
|
1716
|
-
if (!event) return {};
|
|
1717
|
-
const rawEvent = event;
|
|
1718
|
-
if (rawEvent.unsigned?.redacted_because) return remember(cacheKey, {});
|
|
1719
|
-
const replyToBody = summarizeMatrixReplyEvent(rawEvent);
|
|
1720
|
-
if (!replyToBody) return remember(cacheKey, {});
|
|
1721
|
-
const senderId = normalizeOptionalString(rawEvent.sender);
|
|
1722
|
-
const senderName = senderId && await params.getMemberDisplayName(input.roomId, senderId).catch(() => void 0);
|
|
1723
|
-
return remember(cacheKey, {
|
|
1724
|
-
replyToBody,
|
|
1725
|
-
replyToSender: senderName ?? senderId,
|
|
1726
|
-
replyToSenderId: senderId
|
|
1727
|
-
});
|
|
1728
|
-
};
|
|
1729
|
-
}
|
|
1730
|
-
//#endregion
|
|
1731
|
-
//#region extensions/matrix/src/matrix/monitor/thread-context.ts
|
|
1732
|
-
const MAX_TRACKED_THREAD_STARTERS = 256;
|
|
1733
|
-
function summarizeMatrixThreadStarterEvent(event) {
|
|
1734
|
-
const body = summarizeMatrixMessageContextEvent(event);
|
|
1735
|
-
if (body) return truncateMatrixContextBody(body);
|
|
1736
|
-
const content = event.content;
|
|
1737
|
-
const msgtype = normalizeOptionalString(content.msgtype);
|
|
1738
|
-
if (msgtype) return `Matrix ${msgtype} message`;
|
|
1739
|
-
const eventType = normalizeOptionalString(event.type);
|
|
1740
|
-
return eventType ? `Matrix ${eventType} event` : void 0;
|
|
1741
|
-
}
|
|
1742
|
-
function formatMatrixThreadStarterBody(params) {
|
|
1743
|
-
const senderLabel = params.senderName ?? params.senderId ?? "unknown sender";
|
|
1744
|
-
const lines = [`Matrix thread root ${params.threadRootId} from ${senderLabel}:`];
|
|
1745
|
-
if (params.summary) lines.push(params.summary);
|
|
1746
|
-
return lines.join("\n");
|
|
1747
|
-
}
|
|
1748
|
-
function createMatrixThreadContextResolver(params) {
|
|
1749
|
-
const cache = /* @__PURE__ */ new Map();
|
|
1750
|
-
const remember = (key, value) => {
|
|
1751
|
-
setBoundedMap(cache, key, value, MAX_TRACKED_THREAD_STARTERS);
|
|
1752
|
-
return value;
|
|
1753
|
-
};
|
|
1754
|
-
return async (input) => {
|
|
1755
|
-
const cacheKey = `${input.roomId}:${input.threadRootId}`;
|
|
1756
|
-
const cached = cache.get(cacheKey);
|
|
1757
|
-
if (cached) return cached;
|
|
1758
|
-
const rootEvent = await params.client.getEvent(input.roomId, input.threadRootId).catch((err) => {
|
|
1759
|
-
params.logVerboseMessage(`matrix: failed resolving thread root room=${input.roomId} id=${input.threadRootId}: ${String(err)}`);
|
|
1760
|
-
return null;
|
|
1761
|
-
});
|
|
1762
|
-
if (!rootEvent) return { threadStarterBody: `Matrix thread root ${input.threadRootId}` };
|
|
1763
|
-
const rawEvent = rootEvent;
|
|
1764
|
-
const senderId = normalizeOptionalString(rawEvent.sender);
|
|
1765
|
-
const senderName = senderId && await params.getMemberDisplayName(input.roomId, senderId).catch(() => void 0);
|
|
1766
|
-
const senderLabel = senderName ?? senderId;
|
|
1767
|
-
const summary = summarizeMatrixThreadStarterEvent(rawEvent);
|
|
1768
|
-
return remember(cacheKey, {
|
|
1769
|
-
threadStarterBody: formatMatrixThreadStarterBody({
|
|
1770
|
-
threadRootId: input.threadRootId,
|
|
1771
|
-
senderId,
|
|
1772
|
-
senderName,
|
|
1773
|
-
summary
|
|
1774
|
-
}),
|
|
1775
|
-
senderId,
|
|
1776
|
-
senderLabel,
|
|
1777
|
-
summary
|
|
1778
|
-
});
|
|
1779
|
-
};
|
|
1780
|
-
}
|
|
1781
|
-
//#endregion
|
|
1782
|
-
//#region extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1783
|
-
async function resolveMatrixInboundContext(config) {
|
|
1784
|
-
const { handler, ingress, roomId, event, eventTs, resolveThreadContext, resolveReplyContext, senderId, sharedDmContextNoticeRooms } = config;
|
|
1785
|
-
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope, resolveStorePath: resolveStorePathImpl, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl, finalizeInboundContext } = handler;
|
|
1786
|
-
const { cfg, resolveMessageIngress, route: _route, isDirectMessage, isRoom, effectiveRoomUsers, effectiveGroupAllowFrom, threadRootId, thread, senderName, bodyText, commandBodyText, roomConfig, messageId, inboundHistory, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, shouldRequireMention, commandAuthorized, locationPayload, media, preflightAudioTranscript, hasExplicitSessionBinding } = ingress;
|
|
1787
|
-
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
1788
|
-
cfg,
|
|
1789
|
-
channel: "matrix",
|
|
1790
|
-
accountId
|
|
1791
|
-
});
|
|
1792
|
-
const replyToEventId = resolveMatrixReplyToEventId(event.content);
|
|
1793
|
-
const threadTarget = thread.threadId;
|
|
1794
|
-
const isRoomContextSenderAllowed = (contextSenderId) => {
|
|
1795
|
-
if (!isRoom || !contextSenderId) return true;
|
|
1796
|
-
if (effectiveRoomUsers.length > 0) return resolveMatrixAllowListMatch({
|
|
1797
|
-
allowList: effectiveRoomUsers,
|
|
1798
|
-
userId: contextSenderId
|
|
1799
|
-
}).allowed;
|
|
1800
|
-
if (groupPolicy === "allowlist" && effectiveGroupAllowFrom.length > 0) return resolveMatrixAllowListMatch({
|
|
1801
|
-
allowList: effectiveGroupAllowFrom,
|
|
1802
|
-
userId: contextSenderId
|
|
1803
|
-
}).allowed;
|
|
1804
|
-
return true;
|
|
1805
|
-
};
|
|
1806
|
-
const shouldIncludeRoomContextSender = (kind, contextSenderId) => evaluateSupplementalContextVisibility({
|
|
1807
|
-
mode: contextVisibilityMode,
|
|
1808
|
-
kind,
|
|
1809
|
-
senderAllowed: isRoomContextSenderAllowed(contextSenderId)
|
|
1810
|
-
}).include;
|
|
1811
|
-
let threadContext = threadRootId ? await resolveThreadContext({
|
|
1812
|
-
roomId,
|
|
1813
|
-
threadRootId
|
|
1814
|
-
}) : void 0;
|
|
1815
|
-
if (threadContext?.senderId && !shouldIncludeRoomContextSender("thread", threadContext.senderId)) {
|
|
1816
|
-
logVerboseMessage(`matrix: drop thread root context (mode=${contextVisibilityMode})`);
|
|
1817
|
-
threadContext = void 0;
|
|
1818
|
-
}
|
|
1819
|
-
let replyContext;
|
|
1820
|
-
if (replyToEventId && replyToEventId === threadRootId && threadContext?.summary) replyContext = {
|
|
1821
|
-
replyToBody: threadContext.summary,
|
|
1822
|
-
replyToSender: threadContext.senderLabel,
|
|
1823
|
-
replyToSenderId: threadContext.senderId
|
|
1824
|
-
};
|
|
1825
|
-
else replyContext = replyToEventId ? await resolveReplyContext({
|
|
1826
|
-
roomId,
|
|
1827
|
-
eventId: replyToEventId
|
|
1828
|
-
}) : void 0;
|
|
1829
|
-
const replySenderAllowed = !replyContext?.replyToSenderId || isRoomContextSenderAllowed(replyContext.replyToSenderId);
|
|
1830
|
-
const roomName = (isRoom ? await getRoomInfo(roomId) : void 0)?.name;
|
|
1831
|
-
const envelopeFrom = isDirectMessage ? senderName : roomName ?? roomId;
|
|
1832
|
-
const textWithId = `${bodyText}\n[matrix event id: ${messageId} room: ${roomId}]`;
|
|
1833
|
-
const storePath = resolveStorePathImpl(cfg.session?.store, { agentId: _route.agentId });
|
|
1834
|
-
const buildEnvelope = createChannelInboundEnvelopeBuilderImpl({
|
|
1835
|
-
cfg,
|
|
1836
|
-
route: _route
|
|
1837
|
-
});
|
|
1838
|
-
const sharedDmNoticeSessionKey = threadTarget ? _route.mainSessionKey || _route.sessionKey : _route.sessionKey;
|
|
1839
|
-
const sharedDmContextNotice = isDirectMessage ? hasExplicitSessionBinding ? null : resolveMatrixSharedDmContextNotice({
|
|
1840
|
-
storePath,
|
|
1841
|
-
sessionKey: sharedDmNoticeSessionKey,
|
|
1842
|
-
roomId,
|
|
1843
|
-
accountId: _route.accountId,
|
|
1844
|
-
dmSessionScope,
|
|
1845
|
-
sentRooms: sharedDmContextNoticeRooms,
|
|
1846
|
-
logVerboseMessage
|
|
1847
|
-
}) : null;
|
|
1848
|
-
const body = buildEnvelope({
|
|
1849
|
-
channel: "Matrix",
|
|
1850
|
-
from: envelopeFrom,
|
|
1851
|
-
timestamp: eventTs ?? void 0,
|
|
1852
|
-
body: textWithId
|
|
1853
|
-
});
|
|
1854
|
-
const groupSystemPrompt = normalizeOptionalString(roomConfig?.systemPrompt);
|
|
1855
|
-
const quoteHidden = Boolean(replyContext && !evaluateSupplementalContextVisibility({
|
|
1856
|
-
mode: contextVisibilityMode,
|
|
1857
|
-
kind: "quote",
|
|
1858
|
-
senderAllowed: replySenderAllowed
|
|
1859
|
-
}).include);
|
|
1860
|
-
const channelIngress = await resolveMessageIngress({
|
|
1861
|
-
agentId: _route.agentId,
|
|
1862
|
-
sessionKey: _route.sessionKey,
|
|
1863
|
-
nativeChannelId: roomId,
|
|
1864
|
-
messageId,
|
|
1865
|
-
inboundEventKind: "user_request"
|
|
1866
|
-
}, {
|
|
1867
|
-
kind: isDirectMessage ? "direct" : "channel",
|
|
1868
|
-
id: roomId,
|
|
1869
|
-
threadId: threadTarget
|
|
1870
|
-
});
|
|
1871
|
-
const ctxPayload = core.channel.inbound.buildContext({
|
|
1872
|
-
channelIngress,
|
|
1873
|
-
channel: "matrix",
|
|
1874
|
-
contextVisibility: contextVisibilityMode,
|
|
1875
|
-
finalize: finalizeInboundContext,
|
|
1876
|
-
supplemental: {
|
|
1877
|
-
quote: replyContext ? {
|
|
1878
|
-
id: threadTarget ? void 0 : replyToEventId ?? void 0,
|
|
1879
|
-
body: replyContext.replyToBody,
|
|
1880
|
-
sender: replyContext.replyToSender,
|
|
1881
|
-
senderAllowed: replySenderAllowed
|
|
1882
|
-
} : void 0,
|
|
1883
|
-
thread: {
|
|
1884
|
-
starterBody: threadContext?.threadStarterBody,
|
|
1885
|
-
senderAllowed: threadContext ? true : void 0
|
|
1886
|
-
},
|
|
1887
|
-
groupSystemPrompt: isRoom ? groupSystemPrompt : void 0
|
|
1888
|
-
},
|
|
1889
|
-
media: await toInboundMediaFactsWithMetadata(media ? [{
|
|
1890
|
-
path: media.path,
|
|
1891
|
-
url: media.path,
|
|
1892
|
-
contentType: media.contentType,
|
|
1893
|
-
transcribed: preflightAudioTranscript !== void 0
|
|
1894
|
-
}] : void 0),
|
|
1895
|
-
messageId,
|
|
1896
|
-
timestamp: eventTs ?? void 0,
|
|
1897
|
-
from: isDirectMessage ? `matrix:${senderId}` : `matrix:channel:${roomId}`,
|
|
1898
|
-
sender: {
|
|
1899
|
-
id: senderId,
|
|
1900
|
-
name: senderName,
|
|
1901
|
-
username: senderId.split(":")[0]?.replace(/^@/, "")
|
|
1902
|
-
},
|
|
1903
|
-
conversation: {
|
|
1904
|
-
kind: isDirectMessage ? "direct" : "channel",
|
|
1905
|
-
id: roomId,
|
|
1906
|
-
label: envelopeFrom,
|
|
1907
|
-
nativeChannelId: roomId,
|
|
1908
|
-
threadId: threadTarget
|
|
1909
|
-
},
|
|
1910
|
-
route: {
|
|
1911
|
-
..._route,
|
|
1912
|
-
routeSessionKey: _route.sessionKey,
|
|
1913
|
-
parentSessionKey: threadTarget && _route.matchedBy !== "binding.channel" ? _route.mainSessionKey : void 0
|
|
1914
|
-
},
|
|
1915
|
-
reply: {
|
|
1916
|
-
to: `room:${roomId}`,
|
|
1917
|
-
replyToId: threadTarget ? void 0 : replyToEventId ?? void 0,
|
|
1918
|
-
messageThreadId: threadTarget,
|
|
1919
|
-
nativeChannelId: roomId
|
|
1920
|
-
},
|
|
1921
|
-
message: {
|
|
1922
|
-
body,
|
|
1923
|
-
rawBody: bodyText,
|
|
1924
|
-
commandBody: commandBodyText,
|
|
1925
|
-
bodyForAgent: bodyText,
|
|
1926
|
-
inboundHistory: inboundHistory && inboundHistory.length > 0 ? inboundHistory : void 0
|
|
1927
|
-
},
|
|
1928
|
-
sessionTranscript: { historyLimit: isRoom ? historyLimit : 0 },
|
|
1929
|
-
access: {
|
|
1930
|
-
...isRoom ? { mentions: {
|
|
1931
|
-
canDetectMention: true,
|
|
1932
|
-
wasMentioned,
|
|
1933
|
-
requireMention: shouldRequireMention
|
|
1934
|
-
} } : {},
|
|
1935
|
-
commands: { authorized: commandAuthorized }
|
|
1936
|
-
},
|
|
1937
|
-
extra: {
|
|
1938
|
-
GroupSubject: isRoom ? roomName ?? roomId : void 0,
|
|
1939
|
-
GroupId: isRoom ? roomId : void 0,
|
|
1940
|
-
...locationPayload?.context,
|
|
1941
|
-
CommandSource: "text",
|
|
1942
|
-
NativeDirectUserId: isDirectMessage ? senderId : void 0
|
|
1943
|
-
}
|
|
1944
|
-
});
|
|
1945
|
-
if (quoteHidden) logVerboseMessage(`matrix: drop reply context (mode=${contextVisibilityMode})`);
|
|
1946
|
-
logVerboseMessage(`matrix inbound: room=${roomId} from=${senderId} preview="${truncateUtf16Safe(bodyText, 200).replace(/\n/g, "\\n")}"`);
|
|
1947
|
-
const replyTarget = ctxPayload.To;
|
|
1948
|
-
if (!replyTarget) {
|
|
1949
|
-
runtime.error?.("matrix: missing reply target");
|
|
1950
|
-
return null;
|
|
1951
|
-
}
|
|
1952
|
-
const { ackReaction, ackReactionScope: ackScope } = resolveMatrixAckReactionConfig({
|
|
1953
|
-
cfg,
|
|
1954
|
-
agentId: _route.agentId,
|
|
1955
|
-
accountId
|
|
1956
|
-
});
|
|
1957
|
-
const shouldAckReaction = () => Boolean(ackReaction && core.channel.reactions.shouldAckReaction({
|
|
1958
|
-
scope: ackScope,
|
|
1959
|
-
isDirect: isDirectMessage,
|
|
1960
|
-
isGroup: isRoom,
|
|
1961
|
-
isMentionableGroup: isRoom,
|
|
1962
|
-
canDetectMention,
|
|
1963
|
-
effectiveWasMentioned,
|
|
1964
|
-
shouldBypassMention
|
|
1965
|
-
}));
|
|
1966
|
-
if (shouldAckReaction() && messageId) loadMatrixSendModule().then(({ reactMatrixMessage }) => reactMatrixMessage(roomId, messageId, ackReaction, client)).catch((err) => {
|
|
1967
|
-
logVerboseMessage(`matrix react failed for room ${roomId}: ${String(err)}`);
|
|
1968
|
-
});
|
|
1969
|
-
if (messageId) loadMatrixSendModule().then(({ sendReadReceiptMatrix }) => sendReadReceiptMatrix(roomId, messageId, client)).catch((err) => {
|
|
1970
|
-
logVerboseMessage(`matrix: read receipt failed room=${roomId} id=${messageId}: ${String(err)}`);
|
|
1971
|
-
});
|
|
1972
|
-
return {
|
|
1973
|
-
replyToEventId,
|
|
1974
|
-
threadTarget,
|
|
1975
|
-
storePath,
|
|
1976
|
-
ctxPayload,
|
|
1977
|
-
replyTarget,
|
|
1978
|
-
sharedDmContextNotice
|
|
1979
|
-
};
|
|
1980
|
-
}
|
|
1981
|
-
//#endregion
|
|
1982
|
-
//#region extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
|
|
1983
|
-
async function createMatrixDraftController(params) {
|
|
1984
|
-
const { streaming, previewToolProgressEnabled, replyToMode, messageId, threadTarget, accountConfig, cfg, accountId, roomId, client, logVerboseMessage } = params;
|
|
1985
|
-
const draftStreamingEnabled = streaming !== "off";
|
|
1986
|
-
const quietDraftStreaming = streaming === "quiet" || streaming === "progress";
|
|
1987
|
-
const progressDraftStreaming = streaming === "progress";
|
|
1988
|
-
const draftReplyToId = replyToMode !== "off" && !threadTarget ? messageId : void 0;
|
|
1989
|
-
const draftStream = draftStreamingEnabled ? await loadMatrixDraftStream().then(({ createMatrixDraftStream }) => createMatrixDraftStream({
|
|
1990
|
-
roomId,
|
|
1991
|
-
client,
|
|
1992
|
-
cfg,
|
|
1993
|
-
mode: quietDraftStreaming ? "quiet" : "partial",
|
|
1994
|
-
threadId: threadTarget,
|
|
1995
|
-
replyToId: draftReplyToId,
|
|
1996
|
-
preserveReplyId: replyToMode === "all",
|
|
1997
|
-
accountId,
|
|
1998
|
-
log: logVerboseMessage
|
|
1999
|
-
})) : void 0;
|
|
2000
|
-
const shouldSuppressDefaultToolProgressMessages = Boolean(draftStream) && (Boolean(draftStream) && previewToolProgressEnabled || params.streaming === "progress");
|
|
2001
|
-
let currentDraftMessageGeneration = 0;
|
|
2002
|
-
let currentDraftBlockOffset = 0;
|
|
2003
|
-
let latestDraftFullText = "";
|
|
2004
|
-
const pendingDraftBoundaries = [];
|
|
2005
|
-
const latestQueuedDraftBoundaryOffsets = /* @__PURE__ */ new Map();
|
|
2006
|
-
let currentDraftReplyToId = draftReplyToId;
|
|
2007
|
-
const progressConfigEntry = accountConfig ?? cfg.channels?.matrix;
|
|
2008
|
-
const progressSeed = `${accountId}:${roomId}`;
|
|
2009
|
-
const progressDraft = createChannelProgressDraftCompositor({
|
|
2010
|
-
preparedItems: true,
|
|
2011
|
-
entry: progressConfigEntry,
|
|
2012
|
-
mode: streaming === "quiet" ? "partial" : streaming,
|
|
2013
|
-
active: Boolean(draftStream),
|
|
2014
|
-
seed: progressSeed,
|
|
2015
|
-
formatLine: formatMatrixToolProgressMarkdownCode,
|
|
2016
|
-
update: async (text, options) => {
|
|
2017
|
-
const previewText = text.replace(/^• /gmu, "- ");
|
|
2018
|
-
if (!draftStream) return false;
|
|
2019
|
-
draftStream.update(previewText);
|
|
2020
|
-
if (options?.flush) await draftStream.flush();
|
|
2021
|
-
return Boolean(draftStream.eventId());
|
|
2022
|
-
},
|
|
2023
|
-
deleteCurrent: () => draftStream?.deleteCurrentMessage()
|
|
2024
|
-
});
|
|
2025
|
-
const previewLifecycle = createLivePreviewLifecycle({
|
|
2026
|
-
draft: draftStream ? {
|
|
2027
|
-
flush: draftStream.flush,
|
|
2028
|
-
id: draftStream.eventId,
|
|
2029
|
-
seal: draftStream.seal,
|
|
2030
|
-
discardPending: draftStream.discardPending,
|
|
2031
|
-
clear: draftStream.clear
|
|
2032
|
-
} : void 0,
|
|
2033
|
-
cleanupUndelivered: true,
|
|
2034
|
-
onFinalStarted: () => progressDraft.markFinalReplyStarted(),
|
|
2035
|
-
onFinalDelivered: () => progressDraft.markFinalReplyDelivered(),
|
|
2036
|
-
onCleanupFailure: (err) => logVerboseMessage(`matrix draft preview cleanup failed: ${String(err)}`)
|
|
2037
|
-
});
|
|
2038
|
-
const buildPreviewToolProgressReplyOptions = () => {
|
|
2039
|
-
if (!shouldSuppressDefaultToolProgressMessages) return {};
|
|
2040
|
-
return {
|
|
2041
|
-
suppressDefaultToolProgressMessages: true,
|
|
2042
|
-
progressPreambleEnabled: true,
|
|
2043
|
-
commentaryProgressEnabled: progressDraft.commentaryProgressEnabled,
|
|
2044
|
-
onToolStart: async (payload) => {
|
|
2045
|
-
return await progressDraft.pushToolEvent(payload);
|
|
2046
|
-
},
|
|
2047
|
-
onItemEvent: async (payload) => {
|
|
2048
|
-
return await progressDraft.pushItemEvent(payload);
|
|
2049
|
-
},
|
|
2050
|
-
onPlanUpdate: async (payload) => {
|
|
2051
|
-
if (payload.phase !== "update") return false;
|
|
2052
|
-
return await progressDraft.pushPlanProgress(payload.steps, {
|
|
2053
|
-
explanation: payload.explanation,
|
|
2054
|
-
explanationFormat: payload.explanationFormat
|
|
2055
|
-
});
|
|
2056
|
-
},
|
|
2057
|
-
onApprovalEvent: async (payload) => {
|
|
2058
|
-
return await progressDraft.pushApprovalEvent(payload);
|
|
2059
|
-
}
|
|
2060
|
-
};
|
|
2061
|
-
};
|
|
2062
|
-
const getDisplayableDraftText = () => {
|
|
2063
|
-
const nextDraftBoundaryOffset = pendingDraftBoundaries.find((boundary) => boundary.messageGeneration === currentDraftMessageGeneration)?.endOffset;
|
|
2064
|
-
if (nextDraftBoundaryOffset === void 0) return latestDraftFullText.slice(currentDraftBlockOffset);
|
|
2065
|
-
return latestDraftFullText.slice(currentDraftBlockOffset, nextDraftBoundaryOffset);
|
|
2066
|
-
};
|
|
2067
|
-
const updateDraftFromLatestFullText = () => {
|
|
2068
|
-
const blockText = getDisplayableDraftText();
|
|
2069
|
-
if (blockText) draftStream?.update(blockText);
|
|
2070
|
-
};
|
|
2071
|
-
const queueDraftBlockBoundary = (payload, context) => {
|
|
2072
|
-
const payloadTextLength = payload.text?.length ?? 0;
|
|
2073
|
-
const messageGeneration = context?.assistantMessageIndex ?? currentDraftMessageGeneration;
|
|
2074
|
-
const nextDraftBoundaryOffset = (latestQueuedDraftBoundaryOffsets.get(messageGeneration) ?? 0) + payloadTextLength;
|
|
2075
|
-
latestQueuedDraftBoundaryOffsets.set(messageGeneration, nextDraftBoundaryOffset);
|
|
2076
|
-
pendingDraftBoundaries.push({
|
|
2077
|
-
messageGeneration,
|
|
2078
|
-
endOffset: nextDraftBoundaryOffset
|
|
2079
|
-
});
|
|
2080
|
-
};
|
|
2081
|
-
const advanceDraftBlockBoundary = (options) => {
|
|
2082
|
-
const completedBoundary = pendingDraftBoundaries.shift();
|
|
2083
|
-
if (completedBoundary) {
|
|
2084
|
-
if (!pendingDraftBoundaries.some((entry) => entry.messageGeneration === completedBoundary.messageGeneration)) latestQueuedDraftBoundaryOffsets.delete(completedBoundary.messageGeneration);
|
|
2085
|
-
if (completedBoundary.messageGeneration === currentDraftMessageGeneration) currentDraftBlockOffset = completedBoundary.endOffset;
|
|
2086
|
-
return;
|
|
2087
|
-
}
|
|
2088
|
-
if (options?.fallbackToLatestEnd) currentDraftBlockOffset = latestDraftFullText.length;
|
|
2089
|
-
};
|
|
2090
|
-
const resetDraftBlockOffsets = () => {
|
|
2091
|
-
currentDraftMessageGeneration += 1;
|
|
2092
|
-
currentDraftBlockOffset = 0;
|
|
2093
|
-
latestDraftFullText = "";
|
|
2094
|
-
};
|
|
2095
|
-
const resetDraftDeliveryState = async () => {
|
|
2096
|
-
await draftStream?.discardPending();
|
|
2097
|
-
draftStream?.reset();
|
|
2098
|
-
previewLifecycle.reset();
|
|
2099
|
-
currentDraftMessageGeneration = 0;
|
|
2100
|
-
currentDraftBlockOffset = 0;
|
|
2101
|
-
latestDraftFullText = "";
|
|
2102
|
-
pendingDraftBoundaries.length = 0;
|
|
2103
|
-
latestQueuedDraftBoundaryOffsets.clear();
|
|
2104
|
-
currentDraftReplyToId = draftReplyToId;
|
|
2105
|
-
progressDraft.beginNewTurn({ force: true });
|
|
2106
|
-
};
|
|
2107
|
-
return {
|
|
2108
|
-
draftStream,
|
|
2109
|
-
previewLifecycle,
|
|
2110
|
-
cancelProgressDraft: () => progressDraft.cancel(),
|
|
2111
|
-
buildPreviewToolProgressReplyOptions,
|
|
2112
|
-
queueDraftBlockBoundary,
|
|
2113
|
-
advanceDraftBlockBoundary,
|
|
2114
|
-
resetDraftBlockOffsets,
|
|
2115
|
-
beginAssistantMessage: () => progressDraft.beginAssistantMessage(),
|
|
2116
|
-
resetDraftDeliveryState,
|
|
2117
|
-
updateDraftFromLatestFullText,
|
|
2118
|
-
beginDraftGeneration: () => {
|
|
2119
|
-
previewLifecycle.reset();
|
|
2120
|
-
progressDraft.beginNewTurn({ force: true });
|
|
2121
|
-
},
|
|
2122
|
-
currentReplyToId: () => currentDraftReplyToId,
|
|
2123
|
-
setCurrentReplyToId: (replyToId) => {
|
|
2124
|
-
currentDraftReplyToId = replyToId;
|
|
2125
|
-
},
|
|
2126
|
-
resetReplyToIdForNextBlock: () => {
|
|
2127
|
-
currentDraftReplyToId = replyToMode === "all" ? draftReplyToId : void 0;
|
|
2128
|
-
},
|
|
2129
|
-
onPartialReply: (text) => {
|
|
2130
|
-
if (progressDraftStreaming) return false;
|
|
2131
|
-
latestDraftFullText = text;
|
|
2132
|
-
if (text.trim()) progressDraft.resetActivity({ suppressed: true });
|
|
2133
|
-
updateDraftFromLatestFullText();
|
|
2134
|
-
return false;
|
|
2135
|
-
}
|
|
2136
|
-
};
|
|
2137
|
-
}
|
|
2138
|
-
//#endregion
|
|
2139
|
-
//#region extensions/matrix/src/matrix/monitor/room-history.ts
|
|
2140
|
-
/** Maximum entries retained per room (hard cap to bound memory). */
|
|
2141
|
-
const DEFAULT_MAX_QUEUE_SIZE = 200;
|
|
2142
|
-
/** Maximum number of rooms to retain queues for (FIFO eviction beyond this). */
|
|
2143
|
-
const DEFAULT_MAX_ROOM_QUEUES = 1e3;
|
|
2144
|
-
/** Maximum number of (agentId, roomId) watermark entries to retain. */
|
|
2145
|
-
const MAX_WATERMARK_ENTRIES = 5e3;
|
|
2146
|
-
/** Maximum prepared trigger snapshots retained per room for retry reuse. */
|
|
2147
|
-
const MAX_PREPARED_TRIGGER_ENTRIES = 500;
|
|
2148
|
-
/** Maximum thread queues retained per room (FIFO eviction beyond this). */
|
|
2149
|
-
const MAX_THREAD_QUEUES_PER_ROOM = 200;
|
|
2150
|
-
function createRoomHistoryTracker(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoomQueues = DEFAULT_MAX_ROOM_QUEUES, maxWatermarkEntries = MAX_WATERMARK_ENTRIES, maxPreparedTriggerEntries = MAX_PREPARED_TRIGGER_ENTRIES) {
|
|
2151
|
-
const roomQueues = /* @__PURE__ */ new Map();
|
|
2152
|
-
/** Maps `{agentId, roomId, scope}` → absolute consumed-up-to index */
|
|
2153
|
-
const agentWatermarks = /* @__PURE__ */ new Map();
|
|
2154
|
-
let nextQueueGeneration = 1;
|
|
2155
|
-
function clearRoomWatermarks(roomId) {
|
|
2156
|
-
for (const key of agentWatermarks.keys()) if (JSON.parse(key)?.roomId === roomId) agentWatermarks.delete(key);
|
|
2157
|
-
}
|
|
2158
|
-
function clearThreadWatermarks(roomId, threadRootId) {
|
|
2159
|
-
for (const key of agentWatermarks.keys()) {
|
|
2160
|
-
const parsed = JSON.parse(key);
|
|
2161
|
-
if (parsed?.roomId === roomId && parsed.scope === threadRootId) agentWatermarks.delete(key);
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
function createHistoryQueue() {
|
|
2165
|
-
return {
|
|
2166
|
-
entries: [],
|
|
2167
|
-
baseIndex: 0,
|
|
2168
|
-
generation: nextQueueGeneration++,
|
|
2169
|
-
preparedTriggers: /* @__PURE__ */ new Map()
|
|
2170
|
-
};
|
|
2171
|
-
}
|
|
2172
|
-
function getOrCreateQueue(roomId) {
|
|
2173
|
-
let queue = roomQueues.get(roomId);
|
|
2174
|
-
if (!queue) {
|
|
2175
|
-
queue = {
|
|
2176
|
-
...createHistoryQueue(),
|
|
2177
|
-
threadQueues: /* @__PURE__ */ new Map()
|
|
2178
|
-
};
|
|
2179
|
-
roomQueues.set(roomId, queue);
|
|
2180
|
-
if (roomQueues.size > maxRoomQueues) {
|
|
2181
|
-
const oldest = roomQueues.keys().next().value;
|
|
2182
|
-
if (oldest !== void 0) {
|
|
2183
|
-
roomQueues.delete(oldest);
|
|
2184
|
-
clearRoomWatermarks(oldest);
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
return queue;
|
|
2189
|
-
}
|
|
2190
|
-
function getOrCreateThreadQueue(roomId, roomQueue, threadRootId) {
|
|
2191
|
-
let queue = roomQueue.threadQueues.get(threadRootId);
|
|
2192
|
-
if (!queue) {
|
|
2193
|
-
queue = createHistoryQueue();
|
|
2194
|
-
roomQueue.threadQueues.set(threadRootId, queue);
|
|
2195
|
-
if (roomQueue.threadQueues.size > MAX_THREAD_QUEUES_PER_ROOM) {
|
|
2196
|
-
const oldest = roomQueue.threadQueues.keys().next().value;
|
|
2197
|
-
if (oldest !== void 0) {
|
|
2198
|
-
roomQueue.threadQueues.delete(oldest);
|
|
2199
|
-
clearThreadWatermarks(roomId, oldest);
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
return queue;
|
|
2204
|
-
}
|
|
2205
|
-
function getScopedQueue(roomId, threadRootId) {
|
|
2206
|
-
const roomQueue = getOrCreateQueue(roomId);
|
|
2207
|
-
return threadRootId ? getOrCreateThreadQueue(roomId, roomQueue, threadRootId) : roomQueue;
|
|
2208
|
-
}
|
|
2209
|
-
function findScopedQueue(roomId, threadRootId) {
|
|
2210
|
-
const roomQueue = roomQueues.get(roomId);
|
|
2211
|
-
if (!roomQueue) return;
|
|
2212
|
-
return threadRootId ? roomQueue.threadQueues.get(threadRootId) : roomQueue;
|
|
2213
|
-
}
|
|
2214
|
-
function appendToQueue(queue, entry) {
|
|
2215
|
-
queue.entries.push(entry);
|
|
2216
|
-
if (queue.entries.length > maxQueueSize) {
|
|
2217
|
-
const overflow = queue.entries.length - maxQueueSize;
|
|
2218
|
-
queue.entries.splice(0, overflow);
|
|
2219
|
-
queue.baseIndex += overflow;
|
|
2220
|
-
}
|
|
2221
|
-
return {
|
|
2222
|
-
snapshotIdx: queue.baseIndex + queue.entries.length,
|
|
2223
|
-
queueGeneration: queue.generation
|
|
2224
|
-
};
|
|
2225
|
-
}
|
|
2226
|
-
function wmKey(agentId, roomId, threadRootId) {
|
|
2227
|
-
return JSON.stringify({
|
|
2228
|
-
agentId,
|
|
2229
|
-
roomId,
|
|
2230
|
-
scope: threadRootId ?? "main"
|
|
2231
|
-
});
|
|
2232
|
-
}
|
|
2233
|
-
function preparedTriggerKey(agentId, messageId) {
|
|
2234
|
-
if (!messageId?.trim()) return null;
|
|
2235
|
-
return `${agentId}:${messageId.trim()}`;
|
|
2236
|
-
}
|
|
2237
|
-
function rememberWatermark(key, snapshotIdx) {
|
|
2238
|
-
const nextSnapshotIdx = Math.max(agentWatermarks.get(key) ?? 0, snapshotIdx);
|
|
2239
|
-
if (agentWatermarks.has(key)) agentWatermarks.delete(key);
|
|
2240
|
-
agentWatermarks.set(key, nextSnapshotIdx);
|
|
2241
|
-
if (agentWatermarks.size > maxWatermarkEntries) {
|
|
2242
|
-
const oldest = agentWatermarks.keys().next().value;
|
|
2243
|
-
if (oldest !== void 0) agentWatermarks.delete(oldest);
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
function markConsumedAfterReservedGap(queue, key, firstReservedRel, snapshotIdx) {
|
|
2247
|
-
const endRel = Math.min(snapshotIdx - queue.baseIndex, queue.entries.length);
|
|
2248
|
-
for (let rel = firstReservedRel + 1; rel < endRel; rel += 1) {
|
|
2249
|
-
const entry = queue.entries[rel];
|
|
2250
|
-
if (!entry || entry.reserved || entry.discarded) continue;
|
|
2251
|
-
entry.consumedBy ??= /* @__PURE__ */ new Set();
|
|
2252
|
-
entry.consumedBy.add(key);
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2255
|
-
function rememberPreparedTrigger(queue, retryKey, prepared) {
|
|
2256
|
-
if (queue.preparedTriggers.has(retryKey)) queue.preparedTriggers.delete(retryKey);
|
|
2257
|
-
queue.preparedTriggers.set(retryKey, prepared);
|
|
2258
|
-
if (queue.preparedTriggers.size > maxPreparedTriggerEntries) {
|
|
2259
|
-
const oldest = queue.preparedTriggers.keys().next().value;
|
|
2260
|
-
if (oldest !== void 0) queue.preparedTriggers.delete(oldest);
|
|
2261
|
-
}
|
|
2262
|
-
return prepared;
|
|
2263
|
-
}
|
|
2264
|
-
function computePendingHistory(queue, agentId, roomId, limit, endAbsExclusive = queue.baseIndex + queue.entries.length, startAbsOverride, threadRootId) {
|
|
2265
|
-
if (limit <= 0 || queue.entries.length === 0) return [];
|
|
2266
|
-
const wm = startAbsOverride ?? agentWatermarks.get(wmKey(agentId, roomId, threadRootId)) ?? 0;
|
|
2267
|
-
const startRel = Math.max(wm, queue.baseIndex) - queue.baseIndex;
|
|
2268
|
-
const endRel = Math.max(startRel, Math.min(endAbsExclusive - queue.baseIndex, queue.entries.length));
|
|
2269
|
-
const available = queue.entries.slice(startRel, endRel).filter((entry) => !entry.discarded && !entry.reserved && !entry.consumedBy?.has(wmKey(agentId, roomId, threadRootId)));
|
|
2270
|
-
return available.length > limit ? available.slice(-limit) : available;
|
|
2271
|
-
}
|
|
2272
|
-
function prepareTriggerInternal(agentId, roomId, limit, entry, threadRootId) {
|
|
2273
|
-
const queue = getScopedQueue(roomId, threadRootId);
|
|
2274
|
-
const retryKey = preparedTriggerKey(agentId, entry.messageId);
|
|
2275
|
-
if (retryKey) {
|
|
2276
|
-
const prepared = queue.preparedTriggers.get(retryKey);
|
|
2277
|
-
if (prepared) return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
2278
|
-
}
|
|
2279
|
-
const prepared = {
|
|
2280
|
-
history: computePendingHistory(queue, agentId, roomId, limit, void 0, void 0, threadRootId),
|
|
2281
|
-
...appendToQueue(queue, entry)
|
|
2282
|
-
};
|
|
2283
|
-
if (retryKey) return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
2284
|
-
return prepared;
|
|
2285
|
-
}
|
|
2286
|
-
return {
|
|
2287
|
-
recordPending(roomId, entry, threadRootId) {
|
|
2288
|
-
appendToQueue(getScopedQueue(roomId, threadRootId), entry);
|
|
2289
|
-
},
|
|
2290
|
-
reservePending(agentId, roomId, entry, threadRootId) {
|
|
2291
|
-
const snapshot = appendToQueue(getScopedQueue(roomId, threadRootId), {
|
|
2292
|
-
...entry,
|
|
2293
|
-
reserved: true
|
|
2294
|
-
});
|
|
2295
|
-
return {
|
|
2296
|
-
...snapshot,
|
|
2297
|
-
slotIdx: snapshot.snapshotIdx - 1,
|
|
2298
|
-
watermarkIdx: agentWatermarks.get(wmKey(agentId, roomId, threadRootId)) ?? 0
|
|
2299
|
-
};
|
|
2300
|
-
},
|
|
2301
|
-
finalizePending(roomId, slot, entry, threadRootId) {
|
|
2302
|
-
const queue = findScopedQueue(roomId, threadRootId);
|
|
2303
|
-
if (!queue || queue.generation !== slot.queueGeneration) return;
|
|
2304
|
-
const rel = slot.slotIdx - queue.baseIndex;
|
|
2305
|
-
if (rel < 0 || rel >= queue.entries.length) return;
|
|
2306
|
-
queue.entries[rel] = entry;
|
|
2307
|
-
},
|
|
2308
|
-
discardPending(roomId, slot, threadRootId) {
|
|
2309
|
-
const queue = findScopedQueue(roomId, threadRootId);
|
|
2310
|
-
if (!queue || queue.generation !== slot.queueGeneration) return;
|
|
2311
|
-
const rel = slot.slotIdx - queue.baseIndex;
|
|
2312
|
-
if (rel < 0 || rel >= queue.entries.length) return;
|
|
2313
|
-
queue.entries[rel] = {
|
|
2314
|
-
sender: "",
|
|
2315
|
-
body: "",
|
|
2316
|
-
messageId: void 0,
|
|
2317
|
-
discarded: true
|
|
2318
|
-
};
|
|
2319
|
-
},
|
|
2320
|
-
prepareTrigger(agentId, roomId, limit, entry, threadRootId) {
|
|
2321
|
-
return prepareTriggerInternal(agentId, roomId, limit, entry, threadRootId);
|
|
2322
|
-
},
|
|
2323
|
-
prepareReservedTrigger(agentId, roomId, limit, slot, entry, threadRootId) {
|
|
2324
|
-
const queue = findScopedQueue(roomId, threadRootId);
|
|
2325
|
-
if (!queue || queue.generation !== slot.queueGeneration) return prepareTriggerInternal(agentId, roomId, limit, entry, threadRootId);
|
|
2326
|
-
const rel = slot.slotIdx - queue.baseIndex;
|
|
2327
|
-
if (rel < 0 || rel >= queue.entries.length) return prepareTriggerInternal(agentId, roomId, limit, entry, threadRootId);
|
|
2328
|
-
const retryKey = preparedTriggerKey(agentId, entry.messageId);
|
|
2329
|
-
if (retryKey) {
|
|
2330
|
-
const prepared = queue.preparedTriggers.get(retryKey);
|
|
2331
|
-
if (prepared) {
|
|
2332
|
-
queue.entries[rel] = {
|
|
2333
|
-
sender: "",
|
|
2334
|
-
body: "",
|
|
2335
|
-
messageId: void 0,
|
|
2336
|
-
discarded: true
|
|
2337
|
-
};
|
|
2338
|
-
return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
queue.entries[rel] = entry;
|
|
2342
|
-
const prepared = {
|
|
2343
|
-
history: computePendingHistory(queue, agentId, roomId, limit, slot.slotIdx, slot.watermarkIdx, threadRootId),
|
|
2344
|
-
snapshotIdx: slot.slotIdx + 1,
|
|
2345
|
-
queueGeneration: queue.generation
|
|
2346
|
-
};
|
|
2347
|
-
if (retryKey) return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
2348
|
-
return prepared;
|
|
2349
|
-
},
|
|
2350
|
-
consumeHistory(agentId, roomId, snapshot, messageId, threadRootId) {
|
|
2351
|
-
const key = wmKey(agentId, roomId, threadRootId);
|
|
2352
|
-
const queue = findScopedQueue(roomId, threadRootId);
|
|
2353
|
-
if (!queue) {
|
|
2354
|
-
agentWatermarks.delete(key);
|
|
2355
|
-
return;
|
|
2356
|
-
}
|
|
2357
|
-
if (queue.generation !== snapshot.queueGeneration) return;
|
|
2358
|
-
const firstReservedRel = queue.entries.findIndex((entry, index) => entry.reserved === true && queue.baseIndex + index < snapshot.snapshotIdx);
|
|
2359
|
-
if (firstReservedRel >= 0) markConsumedAfterReservedGap(queue, key, firstReservedRel, snapshot.snapshotIdx);
|
|
2360
|
-
rememberWatermark(key, firstReservedRel >= 0 ? queue.baseIndex + firstReservedRel : snapshot.snapshotIdx);
|
|
2361
|
-
const retryKey = preparedTriggerKey(agentId, messageId);
|
|
2362
|
-
if (retryKey) queue.preparedTriggers.delete(retryKey);
|
|
2363
|
-
}
|
|
2364
|
-
};
|
|
2365
|
-
}
|
|
2366
|
-
//#endregion
|
|
2367
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-access.ts
|
|
2368
|
-
async function resolveMatrixIngressAccess(config) {
|
|
2369
|
-
const { handler, params: paramsLocal, roomId, event, eventTs, senderId, isReactionEvent, readStoreAllowFrom, shouldSendPairingReply, resolveLiveAccountAllowlists, roomHistoryTracker, commitInboundEventIfClaimed } = config;
|
|
2370
|
-
const { core, cfg, accountId, accountConfig, client, logVerboseMessage, groupPolicy, dmEnabled, dmPolicy, dmThreadReplies, threadReplies, roomsConfig, accountAllowBots, configuredBotUserIds, needsRoomAliasesForConfig, getRoomInfo, getMemberDisplayName } = handler;
|
|
2371
|
-
const content = paramsLocal.content;
|
|
2372
|
-
const isDirectMessage = paramsLocal.isDirectMessage;
|
|
2373
|
-
const isRoom = !isDirectMessage;
|
|
2374
|
-
const { audioPreflightMode, locationPayload, reservedHistorySlot, selfUserId } = paramsLocal;
|
|
2375
|
-
const messageId = event.event_id ?? "";
|
|
2376
|
-
const threadRootId = resolveMatrixThreadRootId(content);
|
|
2377
|
-
const thread = resolveMatrixThreadRouting({
|
|
2378
|
-
isDirectMessage,
|
|
2379
|
-
threadReplies,
|
|
2380
|
-
dmThreadReplies,
|
|
2381
|
-
messageId,
|
|
2382
|
-
threadRootId
|
|
2383
|
-
});
|
|
2384
|
-
const historyThreadId = threadRootId ? thread.threadId : void 0;
|
|
2385
|
-
let reservedHistorySlotConsumed = false;
|
|
2386
|
-
const discardReservedHistorySlot = () => {
|
|
2387
|
-
if (reservedHistorySlot && !reservedHistorySlotConsumed) {
|
|
2388
|
-
roomHistoryTracker.discardPending(roomId, reservedHistorySlot, historyThreadId);
|
|
2389
|
-
reservedHistorySlotConsumed = true;
|
|
2390
|
-
}
|
|
2391
|
-
};
|
|
2392
|
-
const markReservedHistorySlotConsumed = () => {
|
|
2393
|
-
reservedHistorySlotConsumed = true;
|
|
2394
|
-
};
|
|
2395
|
-
const commitInboundEventIfClaimedAndDiscardReserved = async () => {
|
|
2396
|
-
discardReservedHistorySlot();
|
|
2397
|
-
await commitInboundEventIfClaimed();
|
|
2398
|
-
};
|
|
2399
|
-
if (isRoom && groupPolicy === "disabled") {
|
|
2400
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2401
|
-
return;
|
|
2402
|
-
}
|
|
2403
|
-
const roomInfoForConfig = isRoom && needsRoomAliasesForConfig ? await getRoomInfo(roomId, { includeAliases: true }) : void 0;
|
|
2404
|
-
const roomAliasesForConfig = roomInfoForConfig ? [roomInfoForConfig.canonicalAlias ?? "", ...roomInfoForConfig.altAliases].filter(Boolean) : [];
|
|
2405
|
-
const roomConfigInfo = isRoom ? resolveMatrixRoomConfig({
|
|
2406
|
-
rooms: roomsConfig,
|
|
2407
|
-
roomId,
|
|
2408
|
-
aliases: roomAliasesForConfig
|
|
2409
|
-
}) : void 0;
|
|
2410
|
-
const roomConfig = roomConfigInfo?.config;
|
|
2411
|
-
const allowBotsMode = resolveMatrixAllowBotsMode(roomConfig?.allowBots ?? accountAllowBots);
|
|
2412
|
-
const isConfiguredBotSender = configuredBotUserIds.has(senderId);
|
|
2413
|
-
const roomMatchMeta = roomConfigInfo ? `matchKey=${roomConfigInfo.matchKey ?? "none"} matchSource=${roomConfigInfo.matchSource ?? "none"}` : "matchKey=none matchSource=none";
|
|
2414
|
-
if (isConfiguredBotSender && allowBotsMode === "off") {
|
|
2415
|
-
logVerboseMessage(`matrix: drop configured bot sender=${senderId} (allowBots=false${isDirectMessage ? "" : `, ${roomMatchMeta}`})`);
|
|
2416
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2417
|
-
return;
|
|
2418
|
-
}
|
|
2419
|
-
const botLoopProtection = isConfiguredBotSender && senderId !== selfUserId ? {
|
|
2420
|
-
scopeId: accountId,
|
|
2421
|
-
conversationId: roomId,
|
|
2422
|
-
senderId,
|
|
2423
|
-
receiverId: selfUserId,
|
|
2424
|
-
config: mergePairLoopGuardConfig(accountConfig?.botLoopProtection, roomConfig?.botLoopProtection),
|
|
2425
|
-
defaultsConfig: cfg.channels?.defaults?.botLoopProtection,
|
|
2426
|
-
defaultEnabled: true,
|
|
2427
|
-
nowMs: eventTs ?? void 0
|
|
2428
|
-
} : void 0;
|
|
2429
|
-
if (isRoom && roomConfig && !roomConfigInfo?.allowed) {
|
|
2430
|
-
logVerboseMessage(`matrix: room disabled room=${roomId} (${roomMatchMeta})`);
|
|
2431
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2432
|
-
return;
|
|
2433
|
-
}
|
|
2434
|
-
if (isRoom && groupPolicy === "allowlist") {
|
|
2435
|
-
if (!roomConfigInfo?.allowlistConfigured) {
|
|
2436
|
-
logVerboseMessage(`matrix: drop room message (no allowlist, ${roomMatchMeta})`);
|
|
2437
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2438
|
-
return;
|
|
2439
|
-
}
|
|
2440
|
-
if (!roomConfig) {
|
|
2441
|
-
logVerboseMessage(`matrix: drop room message (not in allowlist, ${roomMatchMeta})`);
|
|
2442
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2443
|
-
return;
|
|
2444
|
-
}
|
|
2445
|
-
}
|
|
2446
|
-
let senderNamePromise = null;
|
|
2447
|
-
const getSenderName = async () => {
|
|
2448
|
-
senderNamePromise ??= getMemberDisplayName(roomId, senderId).catch(() => senderId);
|
|
2449
|
-
return await senderNamePromise;
|
|
2450
|
-
};
|
|
2451
|
-
const storeAllowFrom = isDirectMessage && dmPolicy !== "allowlist" && dmPolicy !== "open" ? await readStoreAllowFrom() : [];
|
|
2452
|
-
const roomUsers = roomConfig?.users ?? [];
|
|
2453
|
-
const { liveCfg, liveDmAllowFrom, liveGroupAllowFrom } = await resolveLiveAccountAllowlists();
|
|
2454
|
-
const accessState = await resolveMatrixMonitorAccessState({
|
|
2455
|
-
allowFrom: liveDmAllowFrom,
|
|
2456
|
-
storeAllowFrom,
|
|
2457
|
-
dmPolicy,
|
|
2458
|
-
groupPolicy,
|
|
2459
|
-
groupAllowFrom: liveGroupAllowFrom,
|
|
2460
|
-
roomUsers,
|
|
2461
|
-
senderId,
|
|
2462
|
-
isRoom,
|
|
2463
|
-
conversationId: roomId,
|
|
2464
|
-
accountId,
|
|
2465
|
-
eventKind: isReactionEvent ? "reaction" : "message"
|
|
2466
|
-
});
|
|
2467
|
-
const { effectiveGroupAllowFrom, effectiveRoomUsers, messageIngress } = accessState;
|
|
2468
|
-
const ingressDecision = messageIngress.ingress;
|
|
2469
|
-
if (isDirectMessage) {
|
|
2470
|
-
if (!dmEnabled || dmPolicy === "disabled") {
|
|
2471
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2472
|
-
return;
|
|
2473
|
-
}
|
|
2474
|
-
const senderReason = messageIngress.senderAccess.reasonCode;
|
|
2475
|
-
if (ingressDecision.decision !== "allow") {
|
|
2476
|
-
if (ingressDecision.admission === "pairing-required") {
|
|
2477
|
-
const senderName = await getSenderName();
|
|
2478
|
-
const { code, created } = await core.channel.pairing.upsertPairingRequest({
|
|
2479
|
-
channel: "matrix",
|
|
2480
|
-
id: senderId,
|
|
2481
|
-
accountId,
|
|
2482
|
-
meta: { name: senderName }
|
|
2483
|
-
});
|
|
2484
|
-
if (shouldSendPairingReply(senderId, created)) {
|
|
2485
|
-
const pairingReply = core.channel.pairing.buildPairingReply({
|
|
2486
|
-
channel: "matrix",
|
|
2487
|
-
idLine: `Your Matrix user id: ${senderId}`,
|
|
2488
|
-
code
|
|
2489
|
-
});
|
|
2490
|
-
logVerboseMessage(created ? `matrix pairing request sender=${senderId} name=${senderName ?? "unknown"} (reason=${senderReason})` : `matrix pairing reminder sender=${senderId} name=${senderName ?? "unknown"} (reason=${senderReason})`);
|
|
2491
|
-
try {
|
|
2492
|
-
const { sendMessageMatrix } = await loadMatrixSendModule();
|
|
2493
|
-
await sendMessageMatrix(`room:${roomId}`, created ? pairingReply : `${pairingReply}\n\nPairing request is still pending approval. Reusing existing code.`, {
|
|
2494
|
-
client,
|
|
2495
|
-
cfg,
|
|
2496
|
-
accountId
|
|
2497
|
-
});
|
|
2498
|
-
await commitInboundEventIfClaimed();
|
|
2499
|
-
} catch (err) {
|
|
2500
|
-
logVerboseMessage(`matrix pairing reply failed for ${senderId}: ${String(err)}`);
|
|
2501
|
-
discardReservedHistorySlot();
|
|
2502
|
-
return;
|
|
2503
|
-
}
|
|
2504
|
-
} else {
|
|
2505
|
-
logVerboseMessage(`matrix pairing reminder suppressed sender=${senderId} (cooldown)`);
|
|
2506
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
if (isReactionEvent || dmPolicy !== "pairing") {
|
|
2510
|
-
logVerboseMessage(`matrix: blocked ${isReactionEvent ? "reaction" : "dm"} sender ${senderId} (dmPolicy=${dmPolicy}, reason=${senderReason})`);
|
|
2511
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2512
|
-
}
|
|
2513
|
-
return;
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
if (isRoom && ingressDecision.decision !== "allow") {
|
|
2517
|
-
logVerboseMessage(`matrix: blocked sender ${senderId} (ingress=${ingressDecision.reasonCode}, ${roomMatchMeta})`);
|
|
2518
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2519
|
-
return;
|
|
2520
|
-
}
|
|
2521
|
-
if (isRoom) logVerboseMessage(`matrix: allow room ${roomId} (${roomMatchMeta})`);
|
|
2522
|
-
if (isReactionEvent) {
|
|
2523
|
-
const senderName = await getSenderName();
|
|
2524
|
-
const { handleInboundMatrixReaction } = await loadMatrixReactionEvents();
|
|
2525
|
-
await handleInboundMatrixReaction({
|
|
2526
|
-
client,
|
|
2527
|
-
core,
|
|
2528
|
-
cfg,
|
|
2529
|
-
accountId,
|
|
2530
|
-
roomId,
|
|
2531
|
-
event,
|
|
2532
|
-
senderId,
|
|
2533
|
-
senderLabel: senderName,
|
|
2534
|
-
selfUserId,
|
|
2535
|
-
isDirectMessage,
|
|
2536
|
-
logVerboseMessage
|
|
2537
|
-
});
|
|
2538
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2539
|
-
return;
|
|
2540
|
-
}
|
|
2541
|
-
return {
|
|
2542
|
-
cfg: liveCfg,
|
|
2543
|
-
liveDmAllowFrom,
|
|
2544
|
-
content,
|
|
2545
|
-
messageId,
|
|
2546
|
-
audioPreflightMode,
|
|
2547
|
-
isDirectMessage,
|
|
2548
|
-
isRoom,
|
|
2549
|
-
locationPayload,
|
|
2550
|
-
reservedHistorySlot,
|
|
2551
|
-
threadRootId,
|
|
2552
|
-
thread,
|
|
2553
|
-
historyThreadId,
|
|
2554
|
-
discardReservedHistorySlot,
|
|
2555
|
-
markReservedHistorySlotConsumed,
|
|
2556
|
-
commitInboundEventIfClaimedAndDiscardReserved,
|
|
2557
|
-
roomConfig,
|
|
2558
|
-
allowBotsMode,
|
|
2559
|
-
isConfiguredBotSender,
|
|
2560
|
-
selfUserId,
|
|
2561
|
-
botLoopProtection,
|
|
2562
|
-
roomMatchMeta,
|
|
2563
|
-
getSenderName,
|
|
2564
|
-
accessState,
|
|
2565
|
-
effectiveGroupAllowFrom,
|
|
2566
|
-
effectiveRoomUsers
|
|
2567
|
-
};
|
|
2568
|
-
}
|
|
2569
|
-
//#endregion
|
|
2570
|
-
//#region extensions/matrix/src/matrix/monitor/media.ts
|
|
2571
|
-
const MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 3e4;
|
|
2572
|
-
async function downloadMatrixMedia(params) {
|
|
2573
|
-
if (typeof params.sizeBytes === "number" && params.sizeBytes > params.maxBytes) throw new MatrixMediaSizeLimitError();
|
|
2574
|
-
const options = {
|
|
2575
|
-
maxBytes: params.maxBytes,
|
|
2576
|
-
readIdleTimeoutMs: MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS
|
|
2577
|
-
};
|
|
2578
|
-
let buffer;
|
|
2579
|
-
if (params.file) {
|
|
2580
|
-
if (!params.client.crypto) throw new Error("Cannot decrypt media: crypto not enabled");
|
|
2581
|
-
buffer = await params.client.crypto.decryptMedia(params.file, options);
|
|
2582
|
-
if (buffer.byteLength > params.maxBytes) throw new MatrixMediaSizeLimitError();
|
|
2583
|
-
} else try {
|
|
2584
|
-
buffer = await params.client.downloadContent(params.mxcUrl, options);
|
|
2585
|
-
} catch (err) {
|
|
2586
|
-
if (isMatrixMediaSizeLimitError(err)) throw err;
|
|
2587
|
-
throw new Error(`Matrix media download failed: ${String(err)}`, { cause: err });
|
|
2588
|
-
}
|
|
2589
|
-
const saved = await getMatrixRuntime().channel.media.saveMediaBuffer(buffer, params.contentType, "inbound", params.maxBytes, params.originalFilename);
|
|
2590
|
-
return {
|
|
2591
|
-
path: saved.path,
|
|
2592
|
-
contentType: saved.contentType,
|
|
2593
|
-
placeholder: "[matrix media]"
|
|
2594
|
-
};
|
|
2595
|
-
}
|
|
2596
|
-
//#endregion
|
|
2597
|
-
//#region extensions/matrix/src/matrix/monitor/mentions.ts
|
|
2598
|
-
const MATRIX_HTML_ENTITY_RE = /&(?:#x?[0-9a-f]+|amp|apos|gt|lt|nbsp|quot);/gi;
|
|
2599
|
-
function decodeVisibleHtmlEntities(value) {
|
|
2600
|
-
return value.replace(MATRIX_HTML_ENTITY_RE, (entity) => {
|
|
2601
|
-
const decoded = decodeHtmlEntities(entity.startsWith("&#") ? entity : entity.toLowerCase());
|
|
2602
|
-
return decoded === "\xA0" ? " " : decoded;
|
|
2603
|
-
});
|
|
2604
|
-
}
|
|
2605
|
-
function normalizeVisibleMentionText(value) {
|
|
2606
|
-
return normalizeLowercaseStringOrEmpty(decodeVisibleHtmlEntities(value.replace(/<[^>]+>/g, " ").replace(/[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")).replace(/\s+/g, " "));
|
|
2607
|
-
}
|
|
2608
|
-
function extractVisibleMentionText(value) {
|
|
2609
|
-
return normalizeVisibleMentionText(value ?? "");
|
|
2610
|
-
}
|
|
2611
|
-
function resolveMatrixUserLocalpart(userId) {
|
|
2612
|
-
const trimmed = userId.trim();
|
|
2613
|
-
if (!trimmed.startsWith("@")) return null;
|
|
2614
|
-
const colonIndex = trimmed.indexOf(":");
|
|
2615
|
-
if (colonIndex <= 1) return null;
|
|
2616
|
-
return trimmed.slice(1, colonIndex).trim() || null;
|
|
2617
|
-
}
|
|
2618
|
-
function hasVisibleNativeMatrixUserMention(text, userId) {
|
|
2619
|
-
const localpart = resolveMatrixUserLocalpart(userId);
|
|
2620
|
-
if (!text || !localpart) return false;
|
|
2621
|
-
return new RegExp(String.raw`(?:^|\p{White_Space})(?:${escapeRegExp(userId)}(?=$|\p{White_Space}|:\p{White_Space}|[,!?;](?=$|\p{White_Space}))|${escapeRegExp(`@${localpart}`)}(?=$|\p{White_Space}|:\p{White_Space}))`, "u").test(text);
|
|
2622
|
-
}
|
|
2623
|
-
function resolveMatrixMentionPrefixCandidates(params) {
|
|
2624
|
-
const candidates = [];
|
|
2625
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2626
|
-
const append = (candidate) => {
|
|
2627
|
-
const trimmed = candidate?.trim();
|
|
2628
|
-
if (!trimmed) return;
|
|
2629
|
-
const normalized = normalizeLowercaseStringOrEmpty(trimmed);
|
|
2630
|
-
if (seen.has(normalized)) return;
|
|
2631
|
-
seen.add(normalized);
|
|
2632
|
-
candidates.push(trimmed);
|
|
2633
|
-
};
|
|
2634
|
-
append(params.userId);
|
|
2635
|
-
const localpart = params.userId ? resolveMatrixUserLocalpart(params.userId) : null;
|
|
2636
|
-
append(localpart ? `@${localpart}` : null);
|
|
2637
|
-
append(params.displayName);
|
|
2638
|
-
append(params.displayName ? `@${params.displayName}` : null);
|
|
2639
|
-
append(params.displayName ? `@[${params.displayName}]` : null);
|
|
2640
|
-
return candidates;
|
|
2641
|
-
}
|
|
2642
|
-
function stripMatchedMatrixMentionPrefix(text, pattern) {
|
|
2643
|
-
const match = text.match(pattern);
|
|
2644
|
-
if (!match) return null;
|
|
2645
|
-
return text.slice(match[0].length).trimStart();
|
|
2646
|
-
}
|
|
2647
|
-
function stripNativeMatrixMentionPrefix(text, candidate) {
|
|
2648
|
-
return stripMatchedMatrixMentionPrefix(text, new RegExp(`^\\s*${escapeRegExp(candidate)}(?:\\s*[:,])?(?:\\s+|$)`, "i"));
|
|
2649
|
-
}
|
|
2650
|
-
function stripRegexMatrixMentionPrefix(text, pattern) {
|
|
2651
|
-
const flags = pattern.flags.replace(/[gy]/g, "");
|
|
2652
|
-
return stripMatchedMatrixMentionPrefix(text, new RegExp(`^\\s*(?:${pattern.source})(?:\\s*[:,])?(?:\\s+|$)`, flags));
|
|
2653
|
-
}
|
|
2654
|
-
function stripMatrixMentionPrefix(params) {
|
|
2655
|
-
const text = params.text;
|
|
2656
|
-
if (!text) return text;
|
|
2657
|
-
for (const candidate of resolveMatrixMentionPrefixCandidates(params)) {
|
|
2658
|
-
const stripped = stripNativeMatrixMentionPrefix(text, candidate);
|
|
2659
|
-
if (stripped !== null) return stripped;
|
|
2660
|
-
}
|
|
2661
|
-
for (const pattern of params.mentionRegexes ?? []) {
|
|
2662
|
-
const stripped = stripRegexMatrixMentionPrefix(text, pattern);
|
|
2663
|
-
if (stripped !== null) return stripped;
|
|
2664
|
-
}
|
|
2665
|
-
return text;
|
|
2666
|
-
}
|
|
2667
|
-
function isVisibleMentionLabel(params) {
|
|
2668
|
-
const cleaned = extractVisibleMentionText(params.text);
|
|
2669
|
-
if (!cleaned) return false;
|
|
2670
|
-
if (params.mentionRegexes.some((pattern) => pattern.test(cleaned))) return true;
|
|
2671
|
-
const localpart = resolveMatrixUserLocalpart(params.userId);
|
|
2672
|
-
return [
|
|
2673
|
-
extractVisibleMentionText(params.userId),
|
|
2674
|
-
localpart ? extractVisibleMentionText(localpart) : null,
|
|
2675
|
-
localpart ? extractVisibleMentionText(`@${localpart}`) : null,
|
|
2676
|
-
params.displayName ? extractVisibleMentionText(params.displayName) : null,
|
|
2677
|
-
params.displayName ? extractVisibleMentionText(`@${params.displayName}`) : null,
|
|
2678
|
-
params.displayName ? extractVisibleMentionText(`@[${params.displayName}]`) : null
|
|
2679
|
-
].filter((value) => Boolean(value)).includes(cleaned);
|
|
2680
|
-
}
|
|
2681
|
-
function hasVisibleRoomMention(value) {
|
|
2682
|
-
const cleaned = extractVisibleMentionText(value);
|
|
2683
|
-
return /(^|[^a-z0-9_])@room\b/i.test(cleaned);
|
|
2684
|
-
}
|
|
2685
|
-
/**
|
|
2686
|
-
* Check if formatted_body contains a matrix.to link whose visible label still
|
|
2687
|
-
* looks like a real mention for the given user. Do not trust href alone, since
|
|
2688
|
-
* senders can hide arbitrary matrix.to links behind unrelated link text.
|
|
2689
|
-
* Many Matrix clients (including Element) use HTML links in formatted_body instead of
|
|
2690
|
-
* or in addition to the m.mentions field.
|
|
2691
|
-
*/
|
|
2692
|
-
function checkFormattedBodyMention(params) {
|
|
2693
|
-
if (!params.formattedBody || !params.userId) return false;
|
|
2694
|
-
for (const match of params.formattedBody.matchAll(/<a\b[^>]*href=(["'])(https:\/\/matrix\.to\/#[^"']+)\1[^>]*>(.*?)<\/a>/gis)) {
|
|
2695
|
-
const href = match[2];
|
|
2696
|
-
const visibleLabel = match[3] ?? "";
|
|
2697
|
-
if (!href) continue;
|
|
2698
|
-
try {
|
|
2699
|
-
const parsed = new URL(href);
|
|
2700
|
-
if (decodeURIComponent(parsed.hash.replace(/^#\/?/, "").trim()) !== params.userId.trim()) continue;
|
|
2701
|
-
if (isVisibleMentionLabel({
|
|
2702
|
-
text: visibleLabel,
|
|
2703
|
-
userId: params.userId,
|
|
2704
|
-
mentionRegexes: params.mentionRegexes,
|
|
2705
|
-
displayName: params.displayName
|
|
2706
|
-
})) return true;
|
|
2707
|
-
} catch {
|
|
2708
|
-
continue;
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
return false;
|
|
2712
|
-
}
|
|
2713
|
-
function resolveMentions(params) {
|
|
2714
|
-
const mentions = params.content["m.mentions"];
|
|
2715
|
-
const mentionedUsers = Array.isArray(mentions?.user_ids) ? new Set(mentions.user_ids) : /* @__PURE__ */ new Set();
|
|
2716
|
-
const textMentioned = getMatrixRuntime().channel.mentions.matchesMentionPatterns(params.text ?? "", params.mentionRegexes);
|
|
2717
|
-
const visibleRoomMention = hasVisibleRoomMention(params.text) || hasVisibleRoomMention(params.content.formatted_body);
|
|
2718
|
-
const mentionedInFormattedBody = params.userId ? checkFormattedBodyMention({
|
|
2719
|
-
formattedBody: params.content.formatted_body,
|
|
2720
|
-
userId: params.userId,
|
|
2721
|
-
displayName: params.displayName,
|
|
2722
|
-
mentionRegexes: params.mentionRegexes
|
|
2723
|
-
}) : false;
|
|
2724
|
-
const metadataBackedUserMention = Boolean(params.userId && mentionedUsers.has(params.userId) && (mentionedInFormattedBody || textMentioned || hasVisibleNativeMatrixUserMention(params.text, params.userId)));
|
|
2725
|
-
const metadataBackedRoomMention = Boolean(mentions?.room) && visibleRoomMention;
|
|
2726
|
-
const explicitMention = mentionedInFormattedBody || metadataBackedUserMention || metadataBackedRoomMention;
|
|
2727
|
-
return {
|
|
2728
|
-
wasMentioned: explicitMention || textMentioned || visibleRoomMention,
|
|
2729
|
-
hasExplicitMention: explicitMention
|
|
2730
|
-
};
|
|
2731
|
-
}
|
|
2732
|
-
//#endregion
|
|
2733
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2734
|
-
async function resolveMatrixIngressContent(config) {
|
|
2735
|
-
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, commitInboundEventIfClaimed } = config;
|
|
2736
|
-
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
2737
|
-
const { cfg, liveDmAllowFrom, content: accessContent, messageId, audioPreflightMode, isDirectMessage, isRoom, locationPayload, reservedHistorySlot, threadRootId, thread, historyThreadId, discardReservedHistorySlot, markReservedHistorySlotConsumed, commitInboundEventIfClaimedAndDiscardReserved, roomConfig, allowBotsMode, isConfiguredBotSender, selfUserId, botLoopProtection, roomMatchMeta, getSenderName, accessState, effectiveGroupAllowFrom, effectiveRoomUsers } = access;
|
|
2738
|
-
const { messageIngress, resolveMessageIngress } = accessState;
|
|
2739
|
-
let content = accessContent;
|
|
2740
|
-
let pollSnapshotPromise = null;
|
|
2741
|
-
const getPollSnapshot = async () => {
|
|
2742
|
-
if (!isPollEvent) return null;
|
|
2743
|
-
pollSnapshotPromise ??= fetchMatrixPollSnapshot(client, roomId, event).catch((err) => {
|
|
2744
|
-
logVerboseMessage(`matrix: failed resolving poll snapshot room=${roomId} id=${event.event_id ?? "unknown"}: ${String(err)}`);
|
|
2745
|
-
return null;
|
|
2746
|
-
});
|
|
2747
|
-
return await pollSnapshotPromise;
|
|
2748
|
-
};
|
|
2749
|
-
const mentionPrecheckText = resolveMatrixMentionPrecheckText({
|
|
2750
|
-
eventType,
|
|
2751
|
-
content,
|
|
2752
|
-
locationText: locationPayload?.text
|
|
2753
|
-
});
|
|
2754
|
-
let mediaContent = resolveMatrixInboundMediaContent(content);
|
|
2755
|
-
const mediaUrl = mediaContent.url;
|
|
2756
|
-
const pendingHistoryText = resolveMatrixPendingHistoryText({
|
|
2757
|
-
mentionPrecheckText,
|
|
2758
|
-
content,
|
|
2759
|
-
mediaUrl
|
|
2760
|
-
});
|
|
2761
|
-
const pendingHistoryPollText = !pendingHistoryText && isPollEvent && historyLimit > 0 ? (await getPollSnapshot())?.text : "";
|
|
2762
|
-
if (!mentionPrecheckText && !mediaUrl && !isPollEvent) {
|
|
2763
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2764
|
-
return;
|
|
2765
|
-
}
|
|
2766
|
-
let preflightMedia = null;
|
|
2767
|
-
let mediaDownloadFailed = false;
|
|
2768
|
-
let mediaSizeLimitExceeded = false;
|
|
2769
|
-
let preflightAudioTranscript;
|
|
2770
|
-
const downloadMedia = async (mxcUrl) => {
|
|
2771
|
-
try {
|
|
2772
|
-
return await downloadMatrixMedia({
|
|
2773
|
-
client,
|
|
2774
|
-
mxcUrl,
|
|
2775
|
-
contentType: mediaContent.contentType,
|
|
2776
|
-
sizeBytes: mediaContent.sizeBytes,
|
|
2777
|
-
maxBytes: mediaMaxBytes,
|
|
2778
|
-
file: mediaContent.file,
|
|
2779
|
-
originalFilename: mediaContent.originalFilename
|
|
2780
|
-
});
|
|
2781
|
-
} catch (err) {
|
|
2782
|
-
mediaDownloadFailed = true;
|
|
2783
|
-
mediaSizeLimitExceeded = isMatrixMediaSizeLimitError(err);
|
|
2784
|
-
const errorText = formatErrorMessage(err);
|
|
2785
|
-
logVerboseMessage(`matrix: media download failed room=${roomId} id=${event.event_id ?? "unknown"} type=${content.msgtype} error=${errorText}`);
|
|
2786
|
-
logger.warn("matrix media download failed", {
|
|
2787
|
-
roomId,
|
|
2788
|
-
eventId: event.event_id,
|
|
2789
|
-
msgtype: content.msgtype,
|
|
2790
|
-
encrypted: Boolean(mediaContent.file),
|
|
2791
|
-
error: errorText
|
|
2792
|
-
});
|
|
2793
|
-
return null;
|
|
2794
|
-
}
|
|
2795
|
-
};
|
|
2796
|
-
const { route: _route, configuredBinding: _configuredBinding, runtimeBindingId: _runtimeBindingId } = resolveMatrixInboundRoute({
|
|
2797
|
-
cfg,
|
|
2798
|
-
accountId,
|
|
2799
|
-
roomId,
|
|
2800
|
-
senderId,
|
|
2801
|
-
isDirectMessage,
|
|
2802
|
-
dmSessionScope,
|
|
2803
|
-
threadId: thread.threadId,
|
|
2804
|
-
resolveAgentRoute: core.channel.routing.resolveAgentRoute
|
|
2805
|
-
});
|
|
2806
|
-
const hasExplicitSessionBinding = _configuredBinding !== null || _runtimeBindingId !== null;
|
|
2807
|
-
const preflightAudioMediaUrl = mediaUrl?.startsWith("mxc://") ? mediaUrl : void 0;
|
|
2808
|
-
const shouldRunMatrixAudioPreflight = isMatrixAudioContent({
|
|
2809
|
-
msgtype: typeof content.msgtype === "string" ? content.msgtype : void 0,
|
|
2810
|
-
mimetype: mediaContent.contentType
|
|
2811
|
-
}) && isMatrixAudioMediaEnabled(cfg) && preflightAudioMediaUrl !== void 0;
|
|
2812
|
-
if (shouldRunMatrixAudioPreflight && audioPreflightMode === "defer" && isRoom && historyLimit > 0 && !reservedHistorySlot) {
|
|
2813
|
-
const reserved = roomHistoryTracker.reservePending(_route.agentId, roomId, {
|
|
2814
|
-
sender: senderId,
|
|
2815
|
-
body: pendingHistoryText,
|
|
2816
|
-
timestamp: eventTs ?? void 0,
|
|
2817
|
-
messageId
|
|
2818
|
-
}, historyThreadId);
|
|
2819
|
-
return { deferredPrefix: {
|
|
2820
|
-
...paramsLocal,
|
|
2821
|
-
audioPreflightMode: "run",
|
|
2822
|
-
reservedHistorySlot: reserved
|
|
2823
|
-
} };
|
|
2824
|
-
}
|
|
2825
|
-
if (shouldRunMatrixAudioPreflight) {
|
|
2826
|
-
preflightMedia = await downloadMedia(preflightAudioMediaUrl);
|
|
2827
|
-
if (preflightMedia) preflightAudioTranscript = await resolveMatrixPreflightAudioTranscript({
|
|
2828
|
-
mediaPath: preflightMedia.path,
|
|
2829
|
-
mediaContentType: preflightMedia.contentType,
|
|
2830
|
-
cfg,
|
|
2831
|
-
accountId,
|
|
2832
|
-
chatType: isDirectMessage ? "direct" : "channel",
|
|
2833
|
-
originatingTo: `room:${roomId}`,
|
|
2834
|
-
messageThreadId: thread.threadId,
|
|
2835
|
-
sessionKey: _route.sessionKey
|
|
2836
|
-
});
|
|
2837
|
-
}
|
|
2838
|
-
const agentMentionRegexes = core.channel.mentions.buildMentionRegexes(cfg, _route.agentId, {
|
|
2839
|
-
provider: "matrix",
|
|
2840
|
-
conversationId: roomId,
|
|
2841
|
-
providerPolicy: accountConfig?.mentionPatterns
|
|
2842
|
-
});
|
|
2843
|
-
const selfDisplayName = content.formatted_body ? await getMemberDisplayName(roomId, selfUserId).catch(() => void 0) : void 0;
|
|
2844
|
-
const mentionPrecheckTextWithTranscript = preflightAudioTranscript ? [mentionPrecheckText, preflightAudioTranscript].filter(Boolean).join("\n").trim() : mentionPrecheckText;
|
|
2845
|
-
const { wasMentioned, hasExplicitMention } = resolveMentions({
|
|
2846
|
-
content,
|
|
2847
|
-
userId: selfUserId,
|
|
2848
|
-
displayName: selfDisplayName,
|
|
2849
|
-
text: mentionPrecheckTextWithTranscript,
|
|
2850
|
-
mentionRegexes: agentMentionRegexes
|
|
2851
|
-
});
|
|
2852
|
-
if (isConfiguredBotSender && allowBotsMode === "mentions" && !isDirectMessage && !wasMentioned) {
|
|
2853
|
-
logVerboseMessage(`matrix: drop configured bot sender=${senderId} (allowBots=mentions, missing mention, ${roomMatchMeta})`);
|
|
2854
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2855
|
-
return;
|
|
2856
|
-
}
|
|
2857
|
-
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
2858
|
-
cfg,
|
|
2859
|
-
surface: "matrix"
|
|
2860
|
-
});
|
|
2861
|
-
const useAccessGroups = true;
|
|
2862
|
-
const commandCheckText = stripMatrixMentionPrefix({
|
|
2863
|
-
text: mentionPrecheckText,
|
|
2864
|
-
userId: selfUserId,
|
|
2865
|
-
displayName: selfDisplayName,
|
|
2866
|
-
mentionRegexes: agentMentionRegexes
|
|
2867
|
-
});
|
|
2868
|
-
const hasControlCommandInMessage = core.channel.text.hasControlCommand(commandCheckText, cfg);
|
|
2869
|
-
const commandAccess = await resolveMatrixMonitorCommandAccess(accessState, {
|
|
2870
|
-
useAccessGroups,
|
|
2871
|
-
allowTextCommands,
|
|
2872
|
-
hasControlCommand: hasControlCommandInMessage
|
|
2873
|
-
});
|
|
2874
|
-
const commandAuthorized = commandAccess.authorized;
|
|
2875
|
-
if (isRoom && commandAccess.shouldBlockControlCommand) {
|
|
2876
|
-
logInboundDrop({
|
|
2877
|
-
log: logVerboseMessage,
|
|
2878
|
-
channel: "matrix",
|
|
2879
|
-
reason: "control command (unauthorized)",
|
|
2880
|
-
target: senderId
|
|
2881
|
-
});
|
|
2882
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2883
|
-
return;
|
|
2884
|
-
}
|
|
2885
|
-
const shouldRequireMention = isRoom ? roomConfig?.autoReply === true ? false : roomConfig?.autoReply === false ? true : typeof roomConfig?.requireMention === "boolean" ? roomConfig?.requireMention : true : false;
|
|
2886
|
-
const mentionDecision = resolveInboundMentionDecision({
|
|
2887
|
-
facts: {
|
|
2888
|
-
canDetectMention: true,
|
|
2889
|
-
wasMentioned,
|
|
2890
|
-
hasAnyMention: hasExplicitMention
|
|
2891
|
-
},
|
|
2892
|
-
policy: {
|
|
2893
|
-
isGroup: isRoom,
|
|
2894
|
-
requireMention: shouldRequireMention,
|
|
2895
|
-
allowTextCommands,
|
|
2896
|
-
hasControlCommand: hasControlCommandInMessage,
|
|
2897
|
-
commandAuthorized
|
|
2898
|
-
}
|
|
2899
|
-
});
|
|
2900
|
-
const { effectiveWasMentioned, shouldBypassMention } = mentionDecision;
|
|
2901
|
-
const canDetectMention = agentMentionRegexes.length > 0 || hasExplicitMention;
|
|
2902
|
-
if (mentionDecision.shouldSkip) {
|
|
2903
|
-
const pendingHistoryBody = preflightAudioTranscript ? formatAudioTranscriptForAgent(preflightAudioTranscript) : pendingHistoryText || pendingHistoryPollText;
|
|
2904
|
-
if (historyLimit > 0 && pendingHistoryBody) {
|
|
2905
|
-
const pendingEntry = {
|
|
2906
|
-
sender: senderId,
|
|
2907
|
-
body: pendingHistoryBody,
|
|
2908
|
-
timestamp: eventTs ?? void 0,
|
|
2909
|
-
messageId
|
|
2910
|
-
};
|
|
2911
|
-
if (reservedHistorySlot) {
|
|
2912
|
-
roomHistoryTracker.finalizePending(roomId, reservedHistorySlot, pendingEntry, historyThreadId);
|
|
2913
|
-
markReservedHistorySlotConsumed();
|
|
2914
|
-
} else roomHistoryTracker.recordPending(roomId, pendingEntry, historyThreadId);
|
|
2915
|
-
}
|
|
2916
|
-
logger.info("skipping room message", {
|
|
2917
|
-
roomId,
|
|
2918
|
-
reason: "no-mention"
|
|
2919
|
-
});
|
|
2920
|
-
await commitInboundEventIfClaimed();
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2923
|
-
if (preflightAudioTranscript) await sendMatrixPreflightAudioTranscriptEcho({
|
|
2924
|
-
transcript: preflightAudioTranscript,
|
|
2925
|
-
cfg,
|
|
2926
|
-
accountId,
|
|
2927
|
-
originatingTo: `room:${roomId}`,
|
|
2928
|
-
messageThreadId: thread.threadId
|
|
2929
|
-
});
|
|
2930
|
-
if (isPollEvent) {
|
|
2931
|
-
const pollSnapshot = await getPollSnapshot();
|
|
2932
|
-
if (!pollSnapshot) {
|
|
2933
|
-
discardReservedHistorySlot();
|
|
2934
|
-
return;
|
|
2935
|
-
}
|
|
2936
|
-
content = {
|
|
2937
|
-
msgtype: "m.text",
|
|
2938
|
-
body: pollSnapshot.text
|
|
2939
|
-
};
|
|
2940
|
-
mediaContent = resolveMatrixInboundMediaContent(content);
|
|
2941
|
-
}
|
|
2942
|
-
let media = preflightMedia;
|
|
2943
|
-
const finalMediaUrl = mediaContent.url;
|
|
2944
|
-
if (!media && !mediaDownloadFailed && finalMediaUrl?.startsWith("mxc://")) media = await downloadMedia(finalMediaUrl);
|
|
2945
|
-
let bodyText = resolveMatrixInboundBodyText({
|
|
2946
|
-
rawBody: locationPayload?.text ?? mediaContent.body,
|
|
2947
|
-
filename: typeof content.filename === "string" ? content.filename : void 0,
|
|
2948
|
-
mediaPlaceholder: media?.placeholder,
|
|
2949
|
-
msgtype: content.msgtype,
|
|
2950
|
-
hadMediaUrl: Boolean(finalMediaUrl),
|
|
2951
|
-
mediaDownloadFailed,
|
|
2952
|
-
mediaSizeLimitExceeded
|
|
2953
|
-
});
|
|
2954
|
-
if (preflightMedia && bodyText && bodyText !== preflightMedia.placeholder && isLikelyBareFilename(bodyText)) bodyText = preflightMedia.placeholder;
|
|
2955
|
-
if (preflightAudioTranscript) {
|
|
2956
|
-
const transcriptBody = formatAudioTranscriptForAgent(preflightAudioTranscript);
|
|
2957
|
-
bodyText = !bodyText || bodyText === media?.placeholder ? transcriptBody : `${bodyText}\n${transcriptBody}`;
|
|
2958
|
-
}
|
|
2959
|
-
if (!bodyText) {
|
|
2960
|
-
await commitInboundEventIfClaimedAndDiscardReserved();
|
|
2961
|
-
return;
|
|
2962
|
-
}
|
|
2963
|
-
const commandBodyText = hasControlCommandInMessage ? commandCheckText : bodyText;
|
|
2964
|
-
const senderName = await getSenderName();
|
|
2965
|
-
if (_configuredBinding) {
|
|
2966
|
-
const { ensureConfiguredAcpBindingReady } = await loadAcpBindingRuntime();
|
|
2967
|
-
if (!(await ensureConfiguredAcpBindingReady({
|
|
2968
|
-
cfg,
|
|
2969
|
-
configuredBinding: _configuredBinding
|
|
2970
|
-
})).ok) {
|
|
2971
|
-
logInboundDrop({
|
|
2972
|
-
log: logVerboseMessage,
|
|
2973
|
-
channel: "matrix",
|
|
2974
|
-
reason: "configured ACP binding unavailable",
|
|
2975
|
-
target: _configuredBinding.spec.conversationId
|
|
2976
|
-
});
|
|
2977
|
-
discardReservedHistorySlot();
|
|
2978
|
-
return;
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
if (_runtimeBindingId) {
|
|
2982
|
-
const { getSessionBindingService } = await loadSessionBindingRuntime();
|
|
2983
|
-
getSessionBindingService().touch(_runtimeBindingId, eventTs ?? void 0, {
|
|
2984
|
-
channel: "matrix",
|
|
2985
|
-
accountId
|
|
2986
|
-
});
|
|
2987
|
-
}
|
|
2988
|
-
const preparedTrigger = isRoom && historyLimit > 0 ? reservedHistorySlot ? roomHistoryTracker.prepareReservedTrigger(_route.agentId, roomId, historyLimit, reservedHistorySlot, {
|
|
2989
|
-
sender: senderName,
|
|
2990
|
-
body: bodyText,
|
|
2991
|
-
timestamp: eventTs ?? void 0,
|
|
2992
|
-
messageId
|
|
2993
|
-
}, historyThreadId) : roomHistoryTracker.prepareTrigger(_route.agentId, roomId, historyLimit, {
|
|
2994
|
-
sender: senderName,
|
|
2995
|
-
body: bodyText,
|
|
2996
|
-
timestamp: eventTs ?? void 0,
|
|
2997
|
-
messageId
|
|
2998
|
-
}, historyThreadId) : void 0;
|
|
2999
|
-
if (reservedHistorySlot && preparedTrigger) markReservedHistorySlotConsumed();
|
|
3000
|
-
return {
|
|
3001
|
-
cfg,
|
|
3002
|
-
liveDmAllowFrom,
|
|
3003
|
-
messageIngress,
|
|
3004
|
-
resolveMessageIngress,
|
|
3005
|
-
route: _route,
|
|
3006
|
-
hasExplicitSessionBinding,
|
|
3007
|
-
roomConfig,
|
|
3008
|
-
isDirectMessage,
|
|
3009
|
-
isRoom,
|
|
3010
|
-
shouldRequireMention,
|
|
3011
|
-
wasMentioned,
|
|
3012
|
-
effectiveWasMentioned,
|
|
3013
|
-
shouldBypassMention,
|
|
3014
|
-
canDetectMention,
|
|
3015
|
-
commandAuthorized,
|
|
3016
|
-
inboundHistory: preparedTrigger ? buildInboundHistoryFromEntries({
|
|
3017
|
-
entries: preparedTrigger.history,
|
|
3018
|
-
limit: historyLimit
|
|
3019
|
-
}) : void 0,
|
|
3020
|
-
senderName,
|
|
3021
|
-
bodyText,
|
|
3022
|
-
commandBodyText,
|
|
3023
|
-
media,
|
|
3024
|
-
preflightAudioTranscript,
|
|
3025
|
-
locationPayload,
|
|
3026
|
-
messageId,
|
|
3027
|
-
triggerSnapshot: preparedTrigger,
|
|
3028
|
-
threadRootId,
|
|
3029
|
-
thread,
|
|
3030
|
-
botLoopProtection,
|
|
3031
|
-
effectiveGroupAllowFrom,
|
|
3032
|
-
effectiveRoomUsers
|
|
3033
|
-
};
|
|
3034
|
-
}
|
|
3035
|
-
//#endregion
|
|
3036
|
-
//#region extensions/matrix/src/matrix/monitor/location.ts
|
|
3037
|
-
function decodeGeoUriParamValue(value) {
|
|
3038
|
-
try {
|
|
3039
|
-
return decodeURIComponent(value);
|
|
3040
|
-
} catch {
|
|
3041
|
-
return value;
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
function parseGeoUri(value) {
|
|
3045
|
-
const trimmed = value.trim();
|
|
3046
|
-
if (!trimmed) return null;
|
|
3047
|
-
if (!normalizeLowercaseStringOrEmpty(trimmed).startsWith("geo:")) return null;
|
|
3048
|
-
const [coordsPart, ...paramParts] = trimmed.slice(4).split(";");
|
|
3049
|
-
if (!coordsPart) return null;
|
|
3050
|
-
const coords = coordsPart.split(",");
|
|
3051
|
-
if (coords.length < 2) return null;
|
|
3052
|
-
const latitude = parseStrictFiniteNumber(coords[0] ?? "");
|
|
3053
|
-
const longitude = parseStrictFiniteNumber(coords[1] ?? "");
|
|
3054
|
-
if (latitude === void 0 || longitude === void 0) return null;
|
|
3055
|
-
const params = /* @__PURE__ */ new Map();
|
|
3056
|
-
for (const part of paramParts) {
|
|
3057
|
-
const segment = part.trim();
|
|
3058
|
-
if (!segment) continue;
|
|
3059
|
-
const eqIndex = segment.indexOf("=");
|
|
3060
|
-
const rawKey = eqIndex === -1 ? segment : segment.slice(0, eqIndex);
|
|
3061
|
-
const rawValue = eqIndex === -1 ? "" : segment.slice(eqIndex + 1);
|
|
3062
|
-
const key = normalizeLowercaseStringOrEmpty(rawKey);
|
|
3063
|
-
if (!key) continue;
|
|
3064
|
-
const valuePart = rawValue.trim();
|
|
3065
|
-
params.set(key, valuePart ? decodeGeoUriParamValue(valuePart) : "");
|
|
3066
|
-
}
|
|
3067
|
-
const accuracyRaw = params.get("u");
|
|
3068
|
-
return {
|
|
3069
|
-
latitude,
|
|
3070
|
-
longitude,
|
|
3071
|
-
accuracy: accuracyRaw ? parseStrictFiniteNumber(accuracyRaw) : void 0
|
|
3072
|
-
};
|
|
3073
|
-
}
|
|
3074
|
-
function resolveMatrixLocation(params) {
|
|
3075
|
-
const { eventType, content } = params;
|
|
3076
|
-
if (!(eventType === EventType.Location || eventType === EventType.RoomMessage && content.msgtype === EventType.Location)) return null;
|
|
3077
|
-
const geoUri = normalizeOptionalString(content.geo_uri) ?? "";
|
|
3078
|
-
if (!geoUri) return null;
|
|
3079
|
-
const parsed = parseGeoUri(geoUri);
|
|
3080
|
-
if (!parsed) return null;
|
|
3081
|
-
const caption = normalizeOptionalString(content.body) ?? "";
|
|
3082
|
-
const location = {
|
|
3083
|
-
latitude: parsed.latitude,
|
|
3084
|
-
longitude: parsed.longitude,
|
|
3085
|
-
accuracy: parsed.accuracy,
|
|
3086
|
-
caption: caption || void 0,
|
|
3087
|
-
source: "pin",
|
|
3088
|
-
isLive: false
|
|
3089
|
-
};
|
|
3090
|
-
return {
|
|
3091
|
-
text: formatLocationText(location),
|
|
3092
|
-
context: toLocationContext(location)
|
|
3093
|
-
};
|
|
3094
|
-
}
|
|
3095
|
-
//#endregion
|
|
3096
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-prefix.ts
|
|
3097
|
-
async function readMatrixIngressPrefix(config) {
|
|
3098
|
-
const { client, senderId, dropPreStartupMessages, eventTs, eventAge, startupMs, startupGraceMs, event, eventType, eventId, inboundDeduper, roomId, logVerboseMessage, directTracker, claimInboundReplay } = config;
|
|
3099
|
-
const selfUserId = await client.getUserId();
|
|
3100
|
-
if (senderId === selfUserId) return;
|
|
3101
|
-
if (dropPreStartupMessages) {
|
|
3102
|
-
if (typeof eventTs === "number" && eventTs < startupMs - startupGraceMs) return;
|
|
3103
|
-
if (typeof eventTs !== "number" && typeof eventAge === "number" && eventAge > startupGraceMs) return;
|
|
3104
|
-
}
|
|
3105
|
-
const content = event.content;
|
|
3106
|
-
if (eventType === EventType.RoomMessage && isMatrixVerificationRoomMessage({
|
|
3107
|
-
msgtype: content.msgtype,
|
|
3108
|
-
body: content.body
|
|
3109
|
-
})) {
|
|
3110
|
-
logVerboseMessage(`matrix: skip verification/system room message room=${roomId}`);
|
|
3111
|
-
return;
|
|
3112
|
-
}
|
|
3113
|
-
const locationPayload = resolveMatrixLocation({
|
|
3114
|
-
eventType,
|
|
3115
|
-
content
|
|
3116
|
-
});
|
|
3117
|
-
const relates = content["m.relates_to"];
|
|
3118
|
-
if (relates && "rel_type" in relates && relates.rel_type === RelationType.Replace) return;
|
|
3119
|
-
if (hasBundledMatrixReplacementRelation(event)) return;
|
|
3120
|
-
if (eventId && inboundDeduper) {
|
|
3121
|
-
const claim = await inboundDeduper.claim({
|
|
3122
|
-
roomId,
|
|
3123
|
-
eventId
|
|
3124
|
-
});
|
|
3125
|
-
if (claim.kind === "claimed") claimInboundReplay(claim.handle);
|
|
3126
|
-
else if (claim.kind !== "invalid") {
|
|
3127
|
-
logVerboseMessage(`matrix: skip duplicate inbound event room=${roomId} id=${eventId}`);
|
|
3128
|
-
return;
|
|
3129
|
-
}
|
|
3130
|
-
}
|
|
3131
|
-
return {
|
|
3132
|
-
content,
|
|
3133
|
-
isDirectMessage: await directTracker.isDirectMessage({
|
|
3134
|
-
roomId,
|
|
3135
|
-
senderId,
|
|
3136
|
-
selfUserId
|
|
3137
|
-
}),
|
|
3138
|
-
locationPayload,
|
|
3139
|
-
selfUserId
|
|
3140
|
-
};
|
|
3141
|
-
}
|
|
3142
|
-
//#endregion
|
|
3143
|
-
//#region extensions/matrix/src/matrix/monitor/replies.ts
|
|
3144
|
-
function joinMatrixVisibleContent(contents) {
|
|
3145
|
-
return contents.filter((content) => Boolean(content)).join("\n");
|
|
3146
|
-
}
|
|
3147
|
-
function mergeMatrixReplyDeliveryResults(results) {
|
|
3148
|
-
const single = results.length === 1 ? results[0] : void 0;
|
|
3149
|
-
if (single?.visibleReplySent) return single;
|
|
3150
|
-
const visibleResults = results.filter((result) => result.visibleReplySent);
|
|
3151
|
-
if (visibleResults.length === 0) return {
|
|
3152
|
-
visibleReplySent: false,
|
|
3153
|
-
suppression: { reason: "no_visible_result" }
|
|
3154
|
-
};
|
|
3155
|
-
const content = joinMatrixVisibleContent(visibleResults.map((result) => result.content));
|
|
3156
|
-
if (visibleResults.some((result) => result.receipt || result.messageIds?.length)) return createAcceptedChannelDeliveryResult({
|
|
3157
|
-
deliveryResults: visibleResults,
|
|
3158
|
-
content
|
|
3159
|
-
});
|
|
3160
|
-
return {
|
|
3161
|
-
visibleReplySent: true,
|
|
3162
|
-
content
|
|
3163
|
-
};
|
|
3164
|
-
}
|
|
3165
|
-
function toMatrixPartialDeliveryError(error, settled) {
|
|
3166
|
-
const failedPartial = isChannelPartialDeliveryError(error) ? error.deliveryResult : void 0;
|
|
3167
|
-
const merged = mergeMatrixReplyDeliveryResults([...settled, ...failedPartial ? [failedPartial] : []]);
|
|
3168
|
-
return merged.visibleReplySent ? createChannelPartialDeliveryError(error, {
|
|
3169
|
-
...merged,
|
|
3170
|
-
visibleReplySent: true
|
|
3171
|
-
}) : error;
|
|
3172
|
-
}
|
|
3173
|
-
function createMatrixReplyDeliveryResult(results) {
|
|
3174
|
-
if (results.length === 0) return mergeMatrixReplyDeliveryResults([]);
|
|
3175
|
-
return createAcceptedChannelDeliveryResult({
|
|
3176
|
-
results: results.map((result) => ({ receipt: result.receipt })),
|
|
3177
|
-
content: joinMatrixVisibleContent(results.map((result) => result.content))
|
|
3178
|
-
});
|
|
3179
|
-
}
|
|
3180
|
-
function resolveVisibleMatrixReplyText(text) {
|
|
3181
|
-
if (typeof text !== "string") return;
|
|
3182
|
-
const trimmedStart = text.trimStart();
|
|
3183
|
-
if (!trimmedStart) return text;
|
|
3184
|
-
if (normalizeLowercaseStringOrEmpty(trimmedStart).startsWith("reasoning:")) return;
|
|
3185
|
-
const visibleText = stripReasoningTagsFromText(text, {
|
|
3186
|
-
mode: "strict",
|
|
3187
|
-
trim: "none"
|
|
3188
|
-
});
|
|
3189
|
-
return visibleText.trim() ? visibleText : void 0;
|
|
3190
|
-
}
|
|
3191
|
-
async function deliverMatrixReplies(params) {
|
|
3192
|
-
const core = getMatrixRuntime();
|
|
3193
|
-
const logVerbose = (message) => {
|
|
3194
|
-
if (core.logging.shouldLogVerbose()) params.runtime.log?.(message);
|
|
3195
|
-
};
|
|
3196
|
-
const hasRepliedRef = params.hasRepliedRef ?? { value: false };
|
|
3197
|
-
const acceptedResults = [];
|
|
3198
|
-
try {
|
|
3199
|
-
for (const reply of params.replies) {
|
|
3200
|
-
const visibleText = resolveVisibleMatrixReplyText(reply.text);
|
|
3201
|
-
const { hasMedia, hasText, mediaUrls } = resolveSendableOutboundReplyParts(reply);
|
|
3202
|
-
if (reply.isReasoning === true || !hasMedia && reply.text && visibleText === void 0) {
|
|
3203
|
-
logVerbose("matrix reply suppressed as reasoning-only");
|
|
3204
|
-
continue;
|
|
3205
|
-
}
|
|
3206
|
-
if (!hasText && !hasMedia) {
|
|
3207
|
-
if (reply?.audioAsVoice) {
|
|
3208
|
-
logVerbose("matrix reply has audioAsVoice without media/text; skipping");
|
|
3209
|
-
continue;
|
|
3210
|
-
}
|
|
3211
|
-
params.runtime.error?.("matrix reply missing text/media");
|
|
3212
|
-
continue;
|
|
3213
|
-
}
|
|
3214
|
-
const explicitReplyToId = reply.replyToTag || reply.replyToCurrent ? reply.replyToId?.trim() : void 0;
|
|
3215
|
-
const rawText = visibleText ?? "";
|
|
3216
|
-
const replyToIdForReply = explicitReplyToId || (!params.threadId && params.replyToMode !== "off" && (params.replyToMode === "all" || !hasRepliedRef.value) ? (reply.replyToId ?? params.replyToId)?.trim() : void 0);
|
|
3217
|
-
const fallbackReplyToId = params.threadId ? (reply.replyToId ?? params.replyToId)?.trim() : void 0;
|
|
3218
|
-
const onDeliveryResult = (result) => {
|
|
3219
|
-
acceptedResults.push(result);
|
|
3220
|
-
if (replyToIdForReply) hasRepliedRef.value = true;
|
|
3221
|
-
};
|
|
3222
|
-
const extraContent = resolveMatrixExtraContent(reply);
|
|
3223
|
-
if (mediaUrls.length === 0) {
|
|
3224
|
-
await sendMessageMatrix(params.roomId, rawText, {
|
|
3225
|
-
client: params.client,
|
|
3226
|
-
cfg: params.cfg,
|
|
3227
|
-
replyToId: replyToIdForReply,
|
|
3228
|
-
fallbackReplyToId,
|
|
3229
|
-
threadId: params.threadId,
|
|
3230
|
-
accountId: params.accountId,
|
|
3231
|
-
extraContent,
|
|
3232
|
-
onDeliveryResult
|
|
3233
|
-
});
|
|
3234
|
-
continue;
|
|
3235
|
-
}
|
|
3236
|
-
let first = true;
|
|
3237
|
-
for (const mediaUrl of mediaUrls) {
|
|
3238
|
-
const caption = first ? rawText : "";
|
|
3239
|
-
await sendMessageMatrix(params.roomId, caption, {
|
|
3240
|
-
client: params.client,
|
|
3241
|
-
cfg: params.cfg,
|
|
3242
|
-
mediaUrl,
|
|
3243
|
-
mediaLocalRoots: params.mediaLocalRoots,
|
|
3244
|
-
replyToId: replyToIdForReply,
|
|
3245
|
-
fallbackReplyToId,
|
|
3246
|
-
threadId: params.threadId,
|
|
3247
|
-
audioAsVoice: reply.audioAsVoice,
|
|
3248
|
-
accountId: params.accountId,
|
|
3249
|
-
extraContent: first ? extraContent : void 0,
|
|
3250
|
-
onDeliveryResult
|
|
3251
|
-
});
|
|
3252
|
-
first = false;
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
} catch (error) {
|
|
3256
|
-
throw toMatrixPartialDeliveryError(error, [createMatrixReplyDeliveryResult(acceptedResults)]);
|
|
3257
|
-
}
|
|
3258
|
-
return createMatrixReplyDeliveryResult(acceptedResults);
|
|
3259
|
-
}
|
|
3260
|
-
//#endregion
|
|
3261
|
-
//#region extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
3262
|
-
function createMatrixReplyDispatcher(config) {
|
|
3263
|
-
const { cfg, prefixOptions, humanDelay, typingCallbacks, streaming, draftStream, draftController, client, roomId, runtime, replyToMode, threadTarget, replyToEventId, accountId, mediaLocalRoots, logVerboseMessage } = config;
|
|
3264
|
-
const quietDraftStreaming = streaming === "quiet" || streaming === "progress";
|
|
3265
|
-
const hasRepliedRef = { value: false };
|
|
3266
|
-
const deliverPayload = (reply) => deliverMatrixReplies({
|
|
3267
|
-
cfg,
|
|
3268
|
-
replies: [reply],
|
|
3269
|
-
roomId,
|
|
3270
|
-
client,
|
|
3271
|
-
runtime,
|
|
3272
|
-
replyToMode,
|
|
3273
|
-
hasRepliedRef,
|
|
3274
|
-
threadId: threadTarget,
|
|
3275
|
-
replyToId: threadTarget ?? replyToEventId ?? void 0,
|
|
3276
|
-
accountId,
|
|
3277
|
-
mediaLocalRoots
|
|
3278
|
-
});
|
|
3279
|
-
const { previewLifecycle } = draftController;
|
|
3280
|
-
let nonFinalReplyDeliveryFailed = false;
|
|
3281
|
-
const beginNextBlockDraft = () => {
|
|
3282
|
-
draftController.beginDraftGeneration();
|
|
3283
|
-
draftController.advanceDraftBlockBoundary({ fallbackToLatestEnd: true });
|
|
3284
|
-
draftStream?.reset();
|
|
3285
|
-
draftController.resetReplyToIdForNextBlock();
|
|
3286
|
-
draftController.updateDraftFromLatestFullText();
|
|
3287
|
-
};
|
|
3288
|
-
const { deliver: deliverReply, onError: onReplyError, ...turnDispatcherOptions } = {
|
|
3289
|
-
...prefixOptions,
|
|
3290
|
-
humanDelay,
|
|
3291
|
-
deliver: async (payload, info) => {
|
|
3292
|
-
const completeDelivery = async (result) => {
|
|
3293
|
-
if (info.kind === "block") {
|
|
3294
|
-
beginNextBlockDraft();
|
|
3295
|
-
await typingCallbacks.onReplyStart();
|
|
3296
|
-
}
|
|
3297
|
-
return result;
|
|
3298
|
-
};
|
|
3299
|
-
const createDraftReceipt = (id) => createPreviewMessageReceipt({
|
|
3300
|
-
id,
|
|
3301
|
-
...threadTarget ? { threadId: threadTarget } : {},
|
|
3302
|
-
...draftController.currentReplyToId() ? { replyToId: draftController.currentReplyToId() } : {}
|
|
3303
|
-
});
|
|
3304
|
-
const createDraftDeliveryResult = (id, content) => {
|
|
3305
|
-
const receipt = createDraftReceipt(id);
|
|
3306
|
-
return {
|
|
3307
|
-
messageIds: receipt.platformMessageIds,
|
|
3308
|
-
receipt,
|
|
3309
|
-
visibleReplySent: true,
|
|
3310
|
-
content
|
|
3311
|
-
};
|
|
3312
|
-
};
|
|
3313
|
-
const settlesPreview = Boolean(draftStream) && info.kind !== "tool" && !payload.isCompactionNotice;
|
|
3314
|
-
const ttsSupplement = getReplyPayloadTtsSupplement(payload);
|
|
3315
|
-
const fallbackPayload = settlesPreview && ttsSupplement && ttsSupplement.visibleTextAlreadyDelivered !== true && !payload.text?.trim() ? {
|
|
3316
|
-
...payload,
|
|
3317
|
-
text: ttsSupplement.spokenText
|
|
3318
|
-
} : payload;
|
|
3319
|
-
const { hasMedia } = resolveSendableOutboundReplyParts(payload);
|
|
3320
|
-
const payloadText = payload.text ?? ttsSupplement?.spokenText;
|
|
3321
|
-
const payloadReplyMismatch = (!threadTarget && replyToMode !== "off" || payload.replyToTag || payload.replyToCurrent) && normalizeOptionalString(payload.replyToId) !== draftController.currentReplyToId();
|
|
3322
|
-
let retainedDraftDelivery;
|
|
3323
|
-
let deliveryResult;
|
|
3324
|
-
try {
|
|
3325
|
-
deliveryResult = (await previewLifecycle.deliver({
|
|
3326
|
-
kind: payload.isCompactionNotice ? "tool" : info.kind === "block" ? "final" : info.kind,
|
|
3327
|
-
payload,
|
|
3328
|
-
isError: payload.isError,
|
|
3329
|
-
adapter: draftStream ? {
|
|
3330
|
-
buildFinalEdit: () => payloadText?.trim() && !payload.isError && !payloadReplyMismatch && !draftStream.mustDeliverFinalNormally() ? { text: payloadText } : void 0,
|
|
3331
|
-
editFinal: async (draftEventId, edit) => {
|
|
3332
|
-
if (draftStream.mustDeliverFinalNormally() || await matrixTextWouldActivateMentions(client, edit.text)) return { visibleReplySent: false };
|
|
3333
|
-
const { editMessageMatrix, prepareMatrixSingleText } = await loadMatrixSendModule();
|
|
3334
|
-
const presentationContent = hasMedia ? void 0 : resolveMatrixExtraContent(payload);
|
|
3335
|
-
const extraContent = {
|
|
3336
|
-
...quietDraftStreaming ? buildMatrixFinalizedPreviewContent() : {},
|
|
3337
|
-
...presentationContent
|
|
3338
|
-
};
|
|
3339
|
-
if (!quietDraftStreaming && !presentationContent && draftStream.matchesPreparedText(edit.text)) {
|
|
3340
|
-
if (!await draftStream.finalizeLive()) return { visibleReplySent: false };
|
|
3341
|
-
} else await editMessageMatrix(roomId, draftEventId, edit.text, {
|
|
3342
|
-
client,
|
|
3343
|
-
cfg,
|
|
3344
|
-
threadId: threadTarget,
|
|
3345
|
-
accountId,
|
|
3346
|
-
...Object.keys(extraContent).length > 0 ? { extraContent } : {}
|
|
3347
|
-
});
|
|
3348
|
-
return createDraftDeliveryResult(draftEventId, prepareMatrixSingleText(edit.text, {
|
|
3349
|
-
cfg,
|
|
3350
|
-
accountId,
|
|
3351
|
-
preserveWhitespace: true
|
|
3352
|
-
}).convertedText);
|
|
3353
|
-
},
|
|
3354
|
-
createPreviewReceipt: createDraftReceipt,
|
|
3355
|
-
buildSupplementalPayload: () => hasMedia ? ttsSupplement ? buildTtsSupplementMediaPayload(payload) : {
|
|
3356
|
-
...payload,
|
|
3357
|
-
text: void 0
|
|
3358
|
-
} : void 0,
|
|
3359
|
-
deliverSupplemental: deliverPayload,
|
|
3360
|
-
logPreviewEditFailure: (err) => {
|
|
3361
|
-
logVerboseMessage(`matrix: preview final edit failed: ${String(err)}`);
|
|
3362
|
-
}
|
|
3363
|
-
} : void 0,
|
|
3364
|
-
deliverNormally: async (normalPayload) => {
|
|
3365
|
-
if (settlesPreview && !previewLifecycle.previewFinalized && (hasMedia || payloadText?.trim() || payload.isError || payloadReplyMismatch || draftStream?.mustDeliverFinalNormally())) {
|
|
3366
|
-
const id = draftStream?.eventId();
|
|
3367
|
-
const content = draftStream?.content();
|
|
3368
|
-
if (id && content) retainedDraftDelivery = createDraftDeliveryResult(id, content);
|
|
3369
|
-
}
|
|
3370
|
-
return await deliverPayload(normalPayload === payload ? fallbackPayload : normalPayload);
|
|
3371
|
-
}
|
|
3372
|
-
})).deliveryResult;
|
|
3373
|
-
} catch (error) {
|
|
3374
|
-
if (retainedDraftDelivery) previewLifecycle.retainPreview();
|
|
3375
|
-
throw toMatrixPartialDeliveryError(error, retainedDraftDelivery ? [retainedDraftDelivery] : []);
|
|
3376
|
-
}
|
|
3377
|
-
if (retainedDraftDelivery && !deliveryResult?.visibleReplySent) previewLifecycle.retainPreview();
|
|
3378
|
-
return await completeDelivery(mergeMatrixReplyDeliveryResults([retainedDraftDelivery?.messageIds?.includes(draftStream?.eventId() ?? "") ? retainedDraftDelivery : void 0, deliveryResult].filter((result) => result !== void 0)));
|
|
3379
|
-
},
|
|
3380
|
-
onError: (err, info) => {
|
|
3381
|
-
if (info.kind === "final") previewLifecycle.observeFailure();
|
|
3382
|
-
else nonFinalReplyDeliveryFailed = true;
|
|
3383
|
-
if (info.kind === "block") beginNextBlockDraft();
|
|
3384
|
-
runtime.error?.(`matrix ${info.kind} reply failed: ${String(err)}`);
|
|
3385
|
-
},
|
|
3386
|
-
onReplyStart: typingCallbacks.onReplyStart,
|
|
3387
|
-
onIdle: typingCallbacks.onIdle
|
|
3388
|
-
};
|
|
3389
|
-
return {
|
|
3390
|
-
deliverReply,
|
|
3391
|
-
onReplyError,
|
|
3392
|
-
turnDispatcherOptions,
|
|
3393
|
-
nonFinalReplyDeliveryFailed: () => nonFinalReplyDeliveryFailed
|
|
3394
|
-
};
|
|
3395
|
-
}
|
|
3396
|
-
//#endregion
|
|
3397
|
-
//#region extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
3398
|
-
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
3399
|
-
const PAIRING_REPLY_COOLDOWN_MS = 3e5;
|
|
3400
|
-
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
3401
|
-
function createMatrixHandlerState(config) {
|
|
3402
|
-
const { core, accountId, runtime, allowFromResolvedEntries, groupAllowFromResolvedEntries, resolveLiveUserAllowlist } = config;
|
|
3403
|
-
let cachedStoreAllowFrom = null;
|
|
3404
|
-
let liveDmAllowlistCache = null;
|
|
3405
|
-
let liveGroupAllowlistCache = null;
|
|
3406
|
-
const resolveCachedLiveAllowlist = async (paramsValue) => {
|
|
3407
|
-
const accountConfigLocal = resolveMatrixAccountConfig({
|
|
3408
|
-
cfg: paramsValue.cfg,
|
|
3409
|
-
accountId
|
|
3410
|
-
});
|
|
3411
|
-
const signature = JSON.stringify({
|
|
3412
|
-
entries: (paramsValue.entries ?? []).map((entry) => String(entry).trim()),
|
|
3413
|
-
failClosedOnUnresolved: paramsValue.failClosedOnUnresolved === true,
|
|
3414
|
-
dangerouslyAllowNameMatching: isDangerousNameMatchingEnabled(accountConfigLocal)
|
|
3415
|
-
});
|
|
3416
|
-
if (paramsValue.cache?.signature === signature) return paramsValue.cache.entries;
|
|
3417
|
-
const entries = await resolveLiveUserAllowlist({
|
|
3418
|
-
cfg: paramsValue.cfg,
|
|
3419
|
-
accountId,
|
|
3420
|
-
entries: paramsValue.entries,
|
|
3421
|
-
failClosedOnUnresolved: paramsValue.failClosedOnUnresolved,
|
|
3422
|
-
startupResolvedEntries: paramsValue.startupResolvedEntries,
|
|
3423
|
-
runtime
|
|
3424
|
-
});
|
|
3425
|
-
const next = {
|
|
3426
|
-
signature,
|
|
3427
|
-
entries
|
|
3428
|
-
};
|
|
3429
|
-
paramsValue.updateCache(next);
|
|
3430
|
-
return entries;
|
|
3431
|
-
};
|
|
3432
|
-
const pairingReplySentAtMsBySender = /* @__PURE__ */ new Map();
|
|
3433
|
-
const resolveLiveAccountAllowlists = async () => {
|
|
3434
|
-
const liveCfg = core.config.current();
|
|
3435
|
-
const liveAccountAllowlists = resolveMatrixAccountAllowlistConfig({
|
|
3436
|
-
cfg: liveCfg,
|
|
3437
|
-
accountId
|
|
3438
|
-
});
|
|
3439
|
-
return {
|
|
3440
|
-
liveCfg,
|
|
3441
|
-
liveDmAllowFrom: await resolveCachedLiveAllowlist({
|
|
3442
|
-
cfg: liveCfg,
|
|
3443
|
-
entries: liveAccountAllowlists.dmAllowFrom,
|
|
3444
|
-
startupResolvedEntries: allowFromResolvedEntries,
|
|
3445
|
-
cache: liveDmAllowlistCache,
|
|
3446
|
-
updateCache: (next) => {
|
|
3447
|
-
liveDmAllowlistCache = next;
|
|
3448
|
-
}
|
|
3449
|
-
}),
|
|
3450
|
-
liveGroupAllowFrom: await resolveCachedLiveAllowlist({
|
|
3451
|
-
cfg: liveCfg,
|
|
3452
|
-
entries: liveAccountAllowlists.groupAllowFrom,
|
|
3453
|
-
failClosedOnUnresolved: true,
|
|
3454
|
-
startupResolvedEntries: groupAllowFromResolvedEntries,
|
|
3455
|
-
cache: liveGroupAllowlistCache,
|
|
3456
|
-
updateCache: (next) => {
|
|
3457
|
-
liveGroupAllowlistCache = next;
|
|
3458
|
-
}
|
|
3459
|
-
})
|
|
3460
|
-
};
|
|
3461
|
-
};
|
|
3462
|
-
const readStoreAllowFrom = async () => {
|
|
3463
|
-
const now = Date.now();
|
|
3464
|
-
if (cachedStoreAllowFrom && isFutureDateTimestampMs(cachedStoreAllowFrom.expiresAtMs, { nowMs: now })) return cachedStoreAllowFrom.value;
|
|
3465
|
-
cachedStoreAllowFrom = null;
|
|
3466
|
-
const value = await core.channel.pairing.readAllowFromStore({
|
|
3467
|
-
channel: "matrix",
|
|
3468
|
-
env: process.env,
|
|
3469
|
-
accountId
|
|
3470
|
-
}).catch(() => []);
|
|
3471
|
-
const expiresAtMs = resolveExpiresAtMsFromDurationMs(ALLOW_FROM_STORE_CACHE_TTL_MS, { nowMs: now });
|
|
3472
|
-
cachedStoreAllowFrom = expiresAtMs === void 0 ? null : {
|
|
3473
|
-
value,
|
|
3474
|
-
expiresAtMs
|
|
3475
|
-
};
|
|
3476
|
-
return value;
|
|
3477
|
-
};
|
|
3478
|
-
const shouldSendPairingReply = (senderId, created) => {
|
|
3479
|
-
const now = Date.now();
|
|
3480
|
-
if (created) {
|
|
3481
|
-
pairingReplySentAtMsBySender.set(senderId, now);
|
|
3482
|
-
return true;
|
|
3483
|
-
}
|
|
3484
|
-
const lastSentAtMs = pairingReplySentAtMsBySender.get(senderId);
|
|
3485
|
-
if (typeof lastSentAtMs === "number" && now - lastSentAtMs < PAIRING_REPLY_COOLDOWN_MS) return false;
|
|
3486
|
-
pairingReplySentAtMsBySender.set(senderId, now);
|
|
3487
|
-
if (pairingReplySentAtMsBySender.size > MAX_TRACKED_PAIRING_REPLY_SENDERS) {
|
|
3488
|
-
const oldestSender = pairingReplySentAtMsBySender.keys().next().value;
|
|
3489
|
-
if (typeof oldestSender === "string") pairingReplySentAtMsBySender.delete(oldestSender);
|
|
3490
|
-
}
|
|
3491
|
-
return true;
|
|
3492
|
-
};
|
|
3493
|
-
return {
|
|
3494
|
-
resolveLiveAccountAllowlists,
|
|
3495
|
-
readStoreAllowFrom,
|
|
3496
|
-
shouldSendPairingReply
|
|
3497
|
-
};
|
|
3498
|
-
}
|
|
3499
|
-
//#endregion
|
|
3500
|
-
//#region extensions/matrix/src/matrix/monitor/handler.ts
|
|
3501
|
-
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
3502
|
-
const RESTART_RECOVERY_TOMBSTONE_NOTICE = "This session ended during gateway restart recovery and cannot accept more messages. Send /new or /reset to start a replacement session.";
|
|
3503
|
-
function createMatrixRoomMessageHandler(params) {
|
|
3504
|
-
const { client, core, cfg: startupConfig, accountId, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], configuredBotUserIds = /* @__PURE__ */ new Set(), replyToMode, streaming, previewToolProgressEnabled, blockStreamingEnabled, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getMemberDisplayName, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilder, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
|
|
3505
|
-
const handlerConfig = {
|
|
3506
|
-
...params,
|
|
3507
|
-
allowFromResolvedEntries,
|
|
3508
|
-
groupAllowFromResolvedEntries,
|
|
3509
|
-
configuredBotUserIds,
|
|
3510
|
-
resolveLiveUserAllowlist,
|
|
3511
|
-
resolveStorePath: resolveStorePathImpl,
|
|
3512
|
-
createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl,
|
|
3513
|
-
resolveHumanDelayConfig: resolveHumanDelayConfigImpl
|
|
3514
|
-
};
|
|
3515
|
-
const handlerState = createMatrixHandlerState({
|
|
3516
|
-
core,
|
|
3517
|
-
accountId,
|
|
3518
|
-
runtime,
|
|
3519
|
-
allowFromResolvedEntries,
|
|
3520
|
-
groupAllowFromResolvedEntries,
|
|
3521
|
-
resolveLiveUserAllowlist
|
|
3522
|
-
});
|
|
3523
|
-
const resolveThreadContext = createMatrixThreadContextResolver({
|
|
3524
|
-
client,
|
|
3525
|
-
getMemberDisplayName,
|
|
3526
|
-
logVerboseMessage
|
|
3527
|
-
});
|
|
3528
|
-
const resolveReplyContext = createMatrixReplyContextResolver({
|
|
3529
|
-
client,
|
|
3530
|
-
getMemberDisplayName,
|
|
3531
|
-
logVerboseMessage
|
|
3532
|
-
});
|
|
3533
|
-
const roomHistoryTracker = createRoomHistoryTracker();
|
|
3534
|
-
const roomIngressQueue = new KeyedAsyncQueue();
|
|
3535
|
-
const sharedDmContextNoticeRooms = /* @__PURE__ */ new Set();
|
|
3536
|
-
const runRoomIngress = async (roomId, task) => {
|
|
3537
|
-
return await roomIngressQueue.enqueue(roomId, task);
|
|
3538
|
-
};
|
|
3539
|
-
return async (roomId, event) => {
|
|
3540
|
-
const eventId = typeof event.event_id === "string" ? event.event_id.trim() : "";
|
|
3541
|
-
let inboundReplayClaim;
|
|
3542
|
-
let draftControllerRef;
|
|
3543
|
-
try {
|
|
3544
|
-
const eventType = event.type;
|
|
3545
|
-
if (eventType === EventType.RoomMessageEncrypted) return;
|
|
3546
|
-
const isPollEvent = isPollEventType(eventType);
|
|
3547
|
-
const isReactionEvent = eventType === EventType.Reaction;
|
|
3548
|
-
const locationContent = event.content;
|
|
3549
|
-
const isLocationEvent = eventType === EventType.Location || eventType === EventType.RoomMessage && locationContent.msgtype === EventType.Location;
|
|
3550
|
-
if (eventType !== EventType.RoomMessage && !isPollEvent && !isLocationEvent && !isReactionEvent) return;
|
|
3551
|
-
logVerboseMessage(`matrix: inbound event room=${roomId} type=${eventType} id=${event.event_id ?? "unknown"}`);
|
|
3552
|
-
if (event.unsigned?.redacted_because) return;
|
|
3553
|
-
const senderId = event.sender;
|
|
3554
|
-
if (!senderId) return;
|
|
3555
|
-
const eventTs = event.origin_server_ts;
|
|
3556
|
-
const eventAge = event.unsigned?.age;
|
|
3557
|
-
const commitInboundEventIfClaimed = async () => {
|
|
3558
|
-
const claim = inboundReplayClaim;
|
|
3559
|
-
if (!claim) return;
|
|
3560
|
-
await claim.commit();
|
|
3561
|
-
if (inboundReplayClaim === claim) inboundReplayClaim = void 0;
|
|
3562
|
-
};
|
|
3563
|
-
const readIngressPrefix = () => readMatrixIngressPrefix({
|
|
3564
|
-
client,
|
|
3565
|
-
senderId,
|
|
3566
|
-
dropPreStartupMessages,
|
|
3567
|
-
eventTs: eventTs ?? void 0,
|
|
3568
|
-
eventAge: eventAge ?? void 0,
|
|
3569
|
-
startupMs,
|
|
3570
|
-
startupGraceMs,
|
|
3571
|
-
event,
|
|
3572
|
-
eventType,
|
|
3573
|
-
eventId,
|
|
3574
|
-
inboundDeduper,
|
|
3575
|
-
roomId,
|
|
3576
|
-
logVerboseMessage,
|
|
3577
|
-
directTracker,
|
|
3578
|
-
claimInboundReplay: (handle) => {
|
|
3579
|
-
inboundReplayClaim = handle;
|
|
3580
|
-
}
|
|
3581
|
-
});
|
|
3582
|
-
const continueIngress = async (paramsLocal) => {
|
|
3583
|
-
const access = await resolveMatrixIngressAccess({
|
|
3584
|
-
handler: handlerConfig,
|
|
3585
|
-
params: paramsLocal,
|
|
3586
|
-
roomId,
|
|
3587
|
-
event,
|
|
3588
|
-
eventTs: eventTs ?? void 0,
|
|
3589
|
-
senderId,
|
|
3590
|
-
isReactionEvent,
|
|
3591
|
-
readStoreAllowFrom: handlerState.readStoreAllowFrom,
|
|
3592
|
-
shouldSendPairingReply: handlerState.shouldSendPairingReply,
|
|
3593
|
-
resolveLiveAccountAllowlists: handlerState.resolveLiveAccountAllowlists,
|
|
3594
|
-
roomHistoryTracker,
|
|
3595
|
-
commitInboundEventIfClaimed
|
|
3596
|
-
});
|
|
3597
|
-
if (!access) return;
|
|
3598
|
-
return await resolveMatrixIngressContent({
|
|
3599
|
-
handler: handlerConfig,
|
|
3600
|
-
params: paramsLocal,
|
|
3601
|
-
access,
|
|
3602
|
-
roomId,
|
|
3603
|
-
event,
|
|
3604
|
-
eventType,
|
|
3605
|
-
isPollEvent,
|
|
3606
|
-
eventTs: eventTs ?? void 0,
|
|
3607
|
-
senderId,
|
|
3608
|
-
roomHistoryTracker,
|
|
3609
|
-
commitInboundEventIfClaimed
|
|
3610
|
-
});
|
|
3611
|
-
};
|
|
3612
|
-
const ingressResult = historyLimit > 0 ? await runRoomIngress(roomId, async () => {
|
|
3613
|
-
const prefix = await readIngressPrefix();
|
|
3614
|
-
if (!prefix) return;
|
|
3615
|
-
if (prefix.isDirectMessage) return { deferredPrefix: prefix };
|
|
3616
|
-
const result = await continueIngress({
|
|
3617
|
-
...prefix,
|
|
3618
|
-
audioPreflightMode: shouldDeferMatrixAudioPreflightForRoomIngress({
|
|
3619
|
-
content: prefix.content,
|
|
3620
|
-
cfg: startupConfig
|
|
3621
|
-
}) ? "defer" : "run"
|
|
3622
|
-
});
|
|
3623
|
-
return result && "deferredPrefix" in result ? { deferredPrefix: result.deferredPrefix } : { ingressResult: result };
|
|
3624
|
-
}) : void 0;
|
|
3625
|
-
const resolvedIngressResult = historyLimit > 0 ? ingressResult?.deferredPrefix ? await continueIngress(ingressResult.deferredPrefix) : ingressResult?.ingressResult : await (async () => {
|
|
3626
|
-
const prefix = await readIngressPrefix();
|
|
3627
|
-
if (!prefix) return;
|
|
3628
|
-
return await continueIngress(prefix);
|
|
3629
|
-
})();
|
|
3630
|
-
if (!resolvedIngressResult) return;
|
|
3631
|
-
if ("deferredPrefix" in resolvedIngressResult) return;
|
|
3632
|
-
const { cfg, liveDmAllowFrom, route: _route, roomConfig, isDirectMessage, isRoom, bodyText, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection } = resolvedIngressResult;
|
|
3633
|
-
const inboundContext = await resolveMatrixInboundContext({
|
|
3634
|
-
handler: handlerConfig,
|
|
3635
|
-
ingress: resolvedIngressResult,
|
|
3636
|
-
roomId,
|
|
3637
|
-
event,
|
|
3638
|
-
eventTs: eventTs ?? void 0,
|
|
3639
|
-
resolveThreadContext,
|
|
3640
|
-
resolveReplyContext,
|
|
3641
|
-
senderId,
|
|
3642
|
-
sharedDmContextNoticeRooms
|
|
3643
|
-
});
|
|
3644
|
-
if (!inboundContext) return;
|
|
3645
|
-
const { replyToEventId, threadTarget, storePath, ctxPayload, replyTarget, sharedDmContextNotice } = inboundContext;
|
|
3646
|
-
const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, _route.agentId);
|
|
3647
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
3648
|
-
cfg,
|
|
3649
|
-
agentId: _route.agentId,
|
|
3650
|
-
channel: "matrix",
|
|
3651
|
-
accountId: _route.accountId
|
|
3652
|
-
});
|
|
3653
|
-
const typingCallbacks = createTypingCallbacks({
|
|
3654
|
-
start: async () => {
|
|
3655
|
-
const { sendTypingMatrix } = await loadMatrixSendModule();
|
|
3656
|
-
await sendTypingMatrix(roomId, true, void 0, client);
|
|
3657
|
-
},
|
|
3658
|
-
stop: async () => {
|
|
3659
|
-
const { sendTypingMatrix } = await loadMatrixSendModule();
|
|
3660
|
-
await sendTypingMatrix(roomId, false, void 0, client);
|
|
3661
|
-
},
|
|
3662
|
-
onStartError: (err) => {
|
|
3663
|
-
logTypingFailure({
|
|
3664
|
-
log: logVerboseMessage,
|
|
3665
|
-
channel: "matrix",
|
|
3666
|
-
action: "start",
|
|
3667
|
-
target: roomId,
|
|
3668
|
-
error: err
|
|
3669
|
-
});
|
|
3670
|
-
},
|
|
3671
|
-
onStopError: (err) => {
|
|
3672
|
-
logTypingFailure({
|
|
3673
|
-
log: logVerboseMessage,
|
|
3674
|
-
channel: "matrix",
|
|
3675
|
-
action: "stop",
|
|
3676
|
-
target: roomId,
|
|
3677
|
-
error: err
|
|
3678
|
-
});
|
|
3679
|
-
}
|
|
3680
|
-
});
|
|
3681
|
-
const hookRunner = getGlobalHookRunner();
|
|
3682
|
-
const allowProviderPreview = !((hookRunner?.hasHooks("reply_payload_sending") ?? false) || (hookRunner?.hasHooks("message_sending") ?? false));
|
|
3683
|
-
const draftController = await createMatrixDraftController({
|
|
3684
|
-
streaming: allowProviderPreview ? streaming : "off",
|
|
3685
|
-
previewToolProgressEnabled: allowProviderPreview && previewToolProgressEnabled,
|
|
3686
|
-
replyToMode,
|
|
3687
|
-
messageId,
|
|
3688
|
-
threadTarget,
|
|
3689
|
-
accountConfig: params.accountConfig,
|
|
3690
|
-
cfg,
|
|
3691
|
-
accountId: _route.accountId,
|
|
3692
|
-
roomId,
|
|
3693
|
-
client,
|
|
3694
|
-
logVerboseMessage
|
|
3695
|
-
});
|
|
3696
|
-
const { draftStream } = draftController;
|
|
3697
|
-
draftControllerRef = draftController;
|
|
3698
|
-
const replyDispatcher = createMatrixReplyDispatcher({
|
|
3699
|
-
cfg,
|
|
3700
|
-
prefixOptions,
|
|
3701
|
-
humanDelay: resolveHumanDelayConfigImpl(cfg, _route.agentId),
|
|
3702
|
-
typingCallbacks,
|
|
3703
|
-
streaming,
|
|
3704
|
-
draftStream,
|
|
3705
|
-
draftController,
|
|
3706
|
-
client,
|
|
3707
|
-
roomId,
|
|
3708
|
-
runtime,
|
|
3709
|
-
replyToMode,
|
|
3710
|
-
threadTarget,
|
|
3711
|
-
replyToEventId: replyToEventId ?? void 0,
|
|
3712
|
-
accountId: _route.accountId,
|
|
3713
|
-
mediaLocalRoots,
|
|
3714
|
-
logVerboseMessage
|
|
3715
|
-
});
|
|
3716
|
-
const { deliverReply, onReplyError, turnDispatcherOptions } = replyDispatcher;
|
|
3717
|
-
const pinnedMainDmOwner = isDirectMessage ? resolvePinnedMainDmOwnerFromAllowlist({
|
|
3718
|
-
dmScope: cfg.session?.dmScope,
|
|
3719
|
-
allowFrom: liveDmAllowFrom,
|
|
3720
|
-
normalizeEntry: normalizeMatrixUserId
|
|
3721
|
-
}) : null;
|
|
3722
|
-
const inboundLastRouteSessionKey = resolveInboundLastRouteSessionKey({
|
|
3723
|
-
route: _route,
|
|
3724
|
-
sessionKey: _route.sessionKey
|
|
3725
|
-
});
|
|
3726
|
-
const replayClaimAtDispatch = inboundReplayClaim;
|
|
3727
|
-
const turnAdoptionLifecycle = replayClaimAtDispatch ? {
|
|
3728
|
-
admission: "exclusive",
|
|
3729
|
-
onDeferred: () => {
|
|
3730
|
-
if (inboundReplayClaim !== replayClaimAtDispatch) return false;
|
|
3731
|
-
inboundReplayClaim = void 0;
|
|
3732
|
-
},
|
|
3733
|
-
onAdopted: async () => {
|
|
3734
|
-
if (inboundReplayClaim === replayClaimAtDispatch) inboundReplayClaim = void 0;
|
|
3735
|
-
await replayClaimAtDispatch.commit();
|
|
3736
|
-
},
|
|
3737
|
-
onAbandoned: () => {
|
|
3738
|
-
if (inboundReplayClaim === replayClaimAtDispatch) inboundReplayClaim = void 0;
|
|
3739
|
-
replayClaimAtDispatch.release();
|
|
3740
|
-
}
|
|
3741
|
-
} : void 0;
|
|
3742
|
-
const turnResultPromise = core.channel.inbound.run({
|
|
3743
|
-
channel: "matrix",
|
|
3744
|
-
accountId: _route.accountId,
|
|
3745
|
-
raw: event,
|
|
3746
|
-
...turnAdoptionLifecycle ? { turnAdoptionLifecycle } : {},
|
|
3747
|
-
adapter: {
|
|
3748
|
-
ingest: () => ({
|
|
3749
|
-
id: messageId,
|
|
3750
|
-
rawText: bodyText,
|
|
3751
|
-
textForAgent: ctxPayload.BodyForAgent,
|
|
3752
|
-
textForCommands: ctxPayload.CommandBody,
|
|
3753
|
-
raw: event
|
|
3754
|
-
}),
|
|
3755
|
-
resolveTurn: () => ({
|
|
3756
|
-
cfg,
|
|
3757
|
-
channel: "matrix",
|
|
3758
|
-
accountId: _route.accountId,
|
|
3759
|
-
route: {
|
|
3760
|
-
agentId: _route.agentId,
|
|
3761
|
-
sessionKey: _route.sessionKey
|
|
3762
|
-
},
|
|
3763
|
-
ctxPayload,
|
|
3764
|
-
botLoopProtection,
|
|
3765
|
-
record: {
|
|
3766
|
-
updateLastRoute: isDirectMessage ? {
|
|
3767
|
-
sessionKey: inboundLastRouteSessionKey,
|
|
3768
|
-
channel: "matrix",
|
|
3769
|
-
to: `room:${roomId}`,
|
|
3770
|
-
accountId: _route.accountId,
|
|
3771
|
-
mainDmOwnerPin: inboundLastRouteSessionKey === _route.mainSessionKey && pinnedMainDmOwner ? {
|
|
3772
|
-
ownerRecipient: pinnedMainDmOwner,
|
|
3773
|
-
senderRecipient: normalizeMatrixUserId(senderId),
|
|
3774
|
-
onSkip: ({ ownerRecipient, senderRecipient }) => {
|
|
3775
|
-
logVerboseMessage(`matrix: skip main-session last route for ${senderRecipient} (pinned owner ${ownerRecipient})`);
|
|
3776
|
-
}
|
|
3777
|
-
} : void 0
|
|
3778
|
-
} : void 0,
|
|
3779
|
-
onRecordError: (err) => {
|
|
3780
|
-
logger.warn("failed updating session meta", {
|
|
3781
|
-
error: String(err),
|
|
3782
|
-
storePath,
|
|
3783
|
-
sessionKey: ctxPayload.SessionKey ?? _route.sessionKey
|
|
3784
|
-
});
|
|
3785
|
-
}
|
|
3786
|
-
},
|
|
3787
|
-
afterRecord: async () => {
|
|
3788
|
-
if (sharedDmContextNotice && markTrackedRoomIfFirst(sharedDmContextNoticeRooms, roomId)) try {
|
|
3789
|
-
await client.sendMessage(roomId, {
|
|
3790
|
-
msgtype: "m.notice",
|
|
3791
|
-
body: sharedDmContextNotice
|
|
3792
|
-
});
|
|
3793
|
-
} catch (err) {
|
|
3794
|
-
logVerboseMessage(`matrix: failed sending shared DM session notice room=${roomId}: ${String(err)}`);
|
|
3795
|
-
}
|
|
3796
|
-
},
|
|
3797
|
-
delivery: {
|
|
3798
|
-
observeMessageSent: true,
|
|
3799
|
-
preparePayload: prepareMatrixReplyPayload,
|
|
3800
|
-
deliver: deliverReply,
|
|
3801
|
-
onError: (err, info) => onReplyError(err, info)
|
|
3802
|
-
},
|
|
3803
|
-
dispatcherOptions: {
|
|
3804
|
-
...turnDispatcherOptions,
|
|
3805
|
-
onSettled: () => draftController.cancelProgressDraft()
|
|
3806
|
-
},
|
|
3807
|
-
replyOptions: {
|
|
3808
|
-
skillFilter: roomConfig?.skills,
|
|
3809
|
-
disableBlockStreaming: !blockStreamingEnabled,
|
|
3810
|
-
onPartialReply: draftStream ? (payload) => draftController.onPartialReply(payload.text ?? "") : void 0,
|
|
3811
|
-
onBlockReplyQueued: draftStream ? (payload, context) => {
|
|
3812
|
-
if (payload.isCompactionNotice === true) return false;
|
|
3813
|
-
draftController.queueDraftBlockBoundary(payload, context);
|
|
3814
|
-
return false;
|
|
3815
|
-
} : void 0,
|
|
3816
|
-
onAssistantMessageStart: draftStream ? () => {
|
|
3817
|
-
draftController.resetDraftBlockOffsets();
|
|
3818
|
-
draftController.beginAssistantMessage();
|
|
3819
|
-
return false;
|
|
3820
|
-
} : void 0,
|
|
3821
|
-
onQueuedFollowupAdmitted: draftStream ? draftController.resetDraftDeliveryState : void 0,
|
|
3822
|
-
...draftController.buildPreviewToolProgressReplyOptions(),
|
|
3823
|
-
onObservedReplyDelivery: draftStream ? () => draftController.previewLifecycle.observeDelivery({ visibleReplySent: true }) : void 0,
|
|
3824
|
-
onModelSelected
|
|
3825
|
-
}
|
|
3826
|
-
})
|
|
3827
|
-
}
|
|
3828
|
-
});
|
|
3829
|
-
let turnResult;
|
|
3830
|
-
try {
|
|
3831
|
-
turnResult = await turnResultPromise;
|
|
3832
|
-
} catch (err) {
|
|
3833
|
-
if (extractErrorCode(err) !== SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE) throw err;
|
|
3834
|
-
try {
|
|
3835
|
-
const { sendMessageMatrix } = await loadMatrixSendModule();
|
|
3836
|
-
await sendMessageMatrix(roomId, RESTART_RECOVERY_TOMBSTONE_NOTICE, {
|
|
3837
|
-
cfg,
|
|
3838
|
-
client,
|
|
3839
|
-
accountId: _route.accountId,
|
|
3840
|
-
replyToId: threadTarget || replyToMode === "off" ? void 0 : messageId,
|
|
3841
|
-
fallbackReplyToId: threadTarget,
|
|
3842
|
-
threadId: threadTarget,
|
|
3843
|
-
deliveryQueueId: `matrix:restart-recovery-tombstone:${_route.accountId}:${roomId}:${eventId}`,
|
|
3844
|
-
deliveryPartIndex: 0,
|
|
3845
|
-
deliveryPartCount: 1,
|
|
3846
|
-
extraContent: { msgtype: "m.notice" }
|
|
3847
|
-
});
|
|
3848
|
-
await commitInboundEventIfClaimed();
|
|
3849
|
-
} catch (noticeError) {
|
|
3850
|
-
runtime.error?.(`matrix: failed completing restart-recovery tombstone notice room=${roomId} id=${eventId || "unknown"}: ${String(noticeError)}`);
|
|
3851
|
-
}
|
|
3852
|
-
return;
|
|
3853
|
-
}
|
|
3854
|
-
if (!turnResult.dispatched) {
|
|
3855
|
-
if (turnResult.admission.kind === "drop" && turnResult.admission.reason === "bot-loop-protection") await commitInboundEventIfClaimed();
|
|
3856
|
-
return;
|
|
3857
|
-
}
|
|
3858
|
-
const { dispatchResult } = turnResult;
|
|
3859
|
-
const { queuedFinal } = dispatchResult;
|
|
3860
|
-
if (draftController.previewLifecycle.finalFailed) {
|
|
3861
|
-
logVerboseMessage(`matrix: final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3862
|
-
await commitInboundEventIfClaimed();
|
|
3863
|
-
return;
|
|
3864
|
-
}
|
|
3865
|
-
if (!queuedFinal && replyDispatcher.nonFinalReplyDeliveryFailed()) {
|
|
3866
|
-
logVerboseMessage(`matrix: non-final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3867
|
-
await commitInboundEventIfClaimed();
|
|
3868
|
-
return;
|
|
3869
|
-
}
|
|
3870
|
-
if (isRoom && triggerSnapshot) roomHistoryTracker.consumeHistory(_route.agentId, roomId, triggerSnapshot, messageId, threadRootId ? thread.threadId : void 0);
|
|
3871
|
-
if (!hasFinalInboundReplyDispatch(dispatchResult)) {
|
|
3872
|
-
await commitInboundEventIfClaimed();
|
|
3873
|
-
return;
|
|
3874
|
-
}
|
|
3875
|
-
const finalCount = resolveInboundReplyDispatchCounts(dispatchResult).final;
|
|
3876
|
-
logVerboseMessage(`matrix: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${replyTarget}`);
|
|
3877
|
-
await commitInboundEventIfClaimed();
|
|
3878
|
-
} catch (err) {
|
|
3879
|
-
const draftController = draftControllerRef;
|
|
3880
|
-
if (draftController?.draftStream?.eventId()) draftController.previewLifecycle.retainPreview();
|
|
3881
|
-
runtime.error?.(`matrix handler failed: ${String(err)}`);
|
|
3882
|
-
} finally {
|
|
3883
|
-
const draftStream = draftControllerRef?.draftStream;
|
|
3884
|
-
if (draftStream) {
|
|
3885
|
-
await draftStream.stop().catch(() => void 0);
|
|
3886
|
-
await draftControllerRef?.previewLifecycle.cleanup();
|
|
3887
|
-
await draftStream.cleanupPending();
|
|
3888
|
-
}
|
|
3889
|
-
inboundReplayClaim?.release();
|
|
3890
|
-
}
|
|
3891
|
-
};
|
|
3892
|
-
}
|
|
3893
|
-
//#endregion
|
|
3894
|
-
//#region extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3895
|
-
function shouldPromoteRecentInviteRoom(params) {
|
|
3896
|
-
if (!params.roomInfo.nameResolved || !params.roomInfo.aliasesResolved) return false;
|
|
3897
|
-
const roomAliases = [params.roomInfo.canonicalAlias ?? "", ...params.roomInfo.altAliases].filter(Boolean);
|
|
3898
|
-
if ((params.roomInfo.name?.trim() ?? "") || roomAliases.length > 0) return false;
|
|
3899
|
-
return resolveMatrixRoomConfig({
|
|
3900
|
-
rooms: params.rooms,
|
|
3901
|
-
roomId: params.roomId,
|
|
3902
|
-
aliases: roomAliases
|
|
3903
|
-
}).matchSource === void 0;
|
|
3904
|
-
}
|
|
3905
|
-
//#endregion
|
|
3906
|
-
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3907
|
-
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3908
|
-
import("./config-update-B_4qZ5bV.mjs").then((n) => n.t),
|
|
3909
|
-
import("./device-health-CWOuIirq.mjs").then((n) => n.t),
|
|
3910
|
-
import("./profile-ClrB3IgR.mjs").then((n) => n.n),
|
|
3911
|
-
import("./startup-verification-Cp1Gf7pM.mjs")
|
|
3912
|
-
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3913
|
-
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3914
|
-
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
3915
|
-
syncMatrixOwnProfile: profileModule.syncMatrixOwnProfile,
|
|
3916
|
-
ensureMatrixStartupVerification: startupVerificationModule.ensureMatrixStartupVerification
|
|
3917
|
-
})));
|
|
3918
|
-
async function runMatrixStartupMaintenance(params, deps) {
|
|
3919
|
-
const runtimeDeps = deps ?? await loadMatrixStartupMaintenanceDeps();
|
|
3920
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3921
|
-
try {
|
|
3922
|
-
const profileSync = await runtimeDeps.syncMatrixOwnProfile({
|
|
3923
|
-
client: params.client,
|
|
3924
|
-
userId: params.auth.userId,
|
|
3925
|
-
displayName: params.accountConfig.name,
|
|
3926
|
-
avatarUrl: params.accountConfig.avatarUrl,
|
|
3927
|
-
loadAvatarFromUrl: async (url, maxBytes) => await params.loadWebMedia(url, maxBytes)
|
|
3928
|
-
});
|
|
3929
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3930
|
-
if (profileSync.displayNameUpdated) params.logger.info(`matrix: profile display name updated for ${params.auth.userId}`);
|
|
3931
|
-
if (profileSync.avatarUpdated) params.logger.info(`matrix: profile avatar updated for ${params.auth.userId}`);
|
|
3932
|
-
if (profileSync.convertedAvatarFromHttp && profileSync.resolvedAvatarUrl && params.accountConfig.avatarUrl !== profileSync.resolvedAvatarUrl) {
|
|
3933
|
-
const latestCfg = params.getRuntimeConfig();
|
|
3934
|
-
const updatedCfg = runtimeDeps.updateMatrixAccountConfig(latestCfg, params.accountId, { avatarUrl: profileSync.resolvedAvatarUrl });
|
|
3935
|
-
await params.replaceConfigFile(updatedCfg);
|
|
3936
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3937
|
-
params.logVerboseMessage(`matrix: persisted converted avatar URL for account ${params.accountId} (${profileSync.resolvedAvatarUrl})`);
|
|
3938
|
-
}
|
|
3939
|
-
} catch (err) {
|
|
3940
|
-
if (isMatrixStartupAbortError(err)) throw err;
|
|
3941
|
-
params.logger.warn("matrix: failed to sync profile from config", { error: String(err) });
|
|
3942
|
-
}
|
|
3943
|
-
if (!(params.auth.encryption && params.client.crypto)) return;
|
|
3944
|
-
try {
|
|
3945
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3946
|
-
const deviceHealth = runtimeDeps.summarizeMatrixDeviceHealth(await params.client.listOwnDevices());
|
|
3947
|
-
if (deviceHealth.staleOpenClawDevices.length > 0) params.logger.warn(`matrix: stale OpenClaw devices detected for ${params.auth.userId}: ${deviceHealth.staleOpenClawDevices.map((device) => device.deviceId).join(", ")}. Run 'openclaw matrix devices prune-stale --account ${params.effectiveAccountId}' to keep encrypted-room trust healthy.`);
|
|
3948
|
-
} catch (err) {
|
|
3949
|
-
if (isMatrixStartupAbortError(err)) throw err;
|
|
3950
|
-
params.logger.debug?.("Failed to inspect matrix device hygiene (non-fatal)", { error: String(err) });
|
|
3951
|
-
}
|
|
3952
|
-
try {
|
|
3953
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3954
|
-
const startupVerification = await runtimeDeps.ensureMatrixStartupVerification({
|
|
3955
|
-
client: params.client,
|
|
3956
|
-
auth: params.auth,
|
|
3957
|
-
accountConfig: params.accountConfig,
|
|
3958
|
-
env: params.env
|
|
3959
|
-
});
|
|
3960
|
-
throwIfMatrixStartupAborted(params.abortSignal);
|
|
3961
|
-
if (startupVerification.kind === "verified") params.logger.info("matrix: device is verified by its owner and ready for encrypted rooms");
|
|
3962
|
-
else if (startupVerification.kind === "disabled" || startupVerification.kind === "cooldown" || startupVerification.kind === "pending" || startupVerification.kind === "request-failed") {
|
|
3963
|
-
params.logger.info("matrix: device not verified — run 'openclaw matrix verify device <key>' to enable E2EE");
|
|
3964
|
-
if (startupVerification.kind === "pending") params.logger.info("matrix: startup verification request is already pending; finish it in another Matrix client");
|
|
3965
|
-
else if (startupVerification.kind === "cooldown") params.logVerboseMessage(`matrix: skipped startup verification request due to cooldown (retryAfterMs=${startupVerification.retryAfterMs ?? 0})`);
|
|
3966
|
-
else if (startupVerification.kind === "request-failed") params.logger.debug?.("Matrix startup verification request failed (non-fatal)", { error: startupVerification.error ?? "unknown" });
|
|
3967
|
-
} else if (startupVerification.kind === "requested") params.logger.info("matrix: device not verified — requested verification in another Matrix client");
|
|
3968
|
-
} catch (err) {
|
|
3969
|
-
if (isMatrixStartupAbortError(err)) throw err;
|
|
3970
|
-
params.logger.debug?.("Failed to resolve matrix verification status (non-fatal)", { error: String(err) });
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3973
|
-
//#endregion
|
|
3974
|
-
//#region extensions/matrix/src/matrix/monitor/status.ts
|
|
3975
|
-
function cloneLastDisconnect(value) {
|
|
3976
|
-
if (!value || typeof value === "string") return value ?? null;
|
|
3977
|
-
return { ...value };
|
|
3978
|
-
}
|
|
3979
|
-
function formatSyncError(error) {
|
|
3980
|
-
if (!error) return null;
|
|
3981
|
-
if (error instanceof Error) return error.message || error.name || "unknown";
|
|
3982
|
-
return formatErrorMessage(error);
|
|
3983
|
-
}
|
|
3984
|
-
function createMatrixMonitorStatusController(params) {
|
|
3985
|
-
const status = {
|
|
3986
|
-
accountId: params.accountId,
|
|
3987
|
-
...params.baseUrl ? { baseUrl: params.baseUrl } : {},
|
|
3988
|
-
connected: false,
|
|
3989
|
-
lastConnectedAt: null,
|
|
3990
|
-
lastDisconnect: null,
|
|
3991
|
-
lastError: null,
|
|
3992
|
-
healthState: "starting",
|
|
3993
|
-
lifecycle: "starting"
|
|
3994
|
-
};
|
|
3995
|
-
const emit = () => {
|
|
3996
|
-
params.statusSink?.({
|
|
3997
|
-
...status,
|
|
3998
|
-
lastDisconnect: cloneLastDisconnect(status.lastDisconnect)
|
|
3999
|
-
});
|
|
4000
|
-
};
|
|
4001
|
-
const noteConnected = (at = Date.now(), options) => {
|
|
4002
|
-
const lastConnectedAt = status.connected === true ? status.lastConnectedAt ?? at : at;
|
|
4003
|
-
Object.assign(status, channelReadyPatch({
|
|
4004
|
-
lastConnectedAt,
|
|
4005
|
-
lastEventAt: at,
|
|
4006
|
-
lastDisconnect: null,
|
|
4007
|
-
healthState: "healthy"
|
|
4008
|
-
}));
|
|
4009
|
-
if (options?.transportActivity) Object.assign(status, createTransportActivityStatusPatch(at));
|
|
4010
|
-
emit();
|
|
4011
|
-
};
|
|
4012
|
-
const noteDisconnected = (paramsLocal) => {
|
|
4013
|
-
const at = paramsLocal.at ?? Date.now();
|
|
4014
|
-
const tokenInvalidated = isMatrixAccessTokenInvalidatedError(paramsLocal.error);
|
|
4015
|
-
if (status.lifecycle === "blocked" && status.terminalDisconnect === true && !tokenInvalidated) {
|
|
4016
|
-
status.connected = false;
|
|
4017
|
-
status.lastEventAt = at;
|
|
4018
|
-
emit();
|
|
4019
|
-
return;
|
|
4020
|
-
}
|
|
4021
|
-
const error = formatSyncError(paramsLocal.error);
|
|
4022
|
-
status.connected = false;
|
|
4023
|
-
status.lastEventAt = at;
|
|
4024
|
-
status.lastDisconnect = {
|
|
4025
|
-
at,
|
|
4026
|
-
...error ? { error } : {}
|
|
4027
|
-
};
|
|
4028
|
-
status.healthState = paramsLocal.state.toLowerCase();
|
|
4029
|
-
if (tokenInvalidated) Object.assign(status, channelBlockedPatch(error ?? "Matrix access token invalidated"));
|
|
4030
|
-
else {
|
|
4031
|
-
status.lastError = error;
|
|
4032
|
-
status.lifecycle = "recovering";
|
|
4033
|
-
status.terminalDisconnect = void 0;
|
|
4034
|
-
}
|
|
4035
|
-
emit();
|
|
4036
|
-
};
|
|
4037
|
-
emit();
|
|
4038
|
-
return {
|
|
4039
|
-
noteSyncState(state, error, at = Date.now()) {
|
|
4040
|
-
if (isMatrixReadySyncState(state)) {
|
|
4041
|
-
noteConnected(at, { transportActivity: state === "SYNCING" });
|
|
4042
|
-
return;
|
|
4043
|
-
}
|
|
4044
|
-
if (isMatrixDisconnectedSyncState(state)) {
|
|
4045
|
-
noteDisconnected({
|
|
4046
|
-
state,
|
|
4047
|
-
at,
|
|
4048
|
-
error
|
|
4049
|
-
});
|
|
4050
|
-
return;
|
|
4051
|
-
}
|
|
4052
|
-
status.lastEventAt = at;
|
|
4053
|
-
status.healthState = state.toLowerCase();
|
|
4054
|
-
emit();
|
|
4055
|
-
},
|
|
4056
|
-
noteUnexpectedError(error, at = Date.now()) {
|
|
4057
|
-
noteDisconnected({
|
|
4058
|
-
state: "ERROR",
|
|
4059
|
-
at,
|
|
4060
|
-
error
|
|
4061
|
-
});
|
|
4062
|
-
},
|
|
4063
|
-
markStopped(at = Date.now()) {
|
|
4064
|
-
if (status.lifecycle !== "blocked" && status.healthState !== "error") Object.assign(status, channelStoppedPatch({
|
|
4065
|
-
lastEventAt: at,
|
|
4066
|
-
healthState: "stopped"
|
|
4067
|
-
}));
|
|
4068
|
-
else {
|
|
4069
|
-
status.connected = false;
|
|
4070
|
-
status.lastEventAt = at;
|
|
4071
|
-
}
|
|
4072
|
-
emit();
|
|
4073
|
-
}
|
|
4074
|
-
};
|
|
4075
|
-
}
|
|
4076
|
-
//#endregion
|
|
4077
|
-
//#region extensions/matrix/src/matrix/monitor/sync-lifecycle.ts
|
|
4078
|
-
function formatSyncLifecycleError(state, error) {
|
|
4079
|
-
if (error instanceof Error) return error;
|
|
4080
|
-
const message = typeof error === "string" && error.trim() ? error.trim() : void 0;
|
|
4081
|
-
if (state === "STOPPED") return new Error(message ?? "Matrix sync stopped unexpectedly");
|
|
4082
|
-
if (state === "ERROR") return new Error(message ?? "Matrix sync entered ERROR unexpectedly");
|
|
4083
|
-
return new Error(message ?? `Matrix sync entered ${state} unexpectedly`);
|
|
4084
|
-
}
|
|
4085
|
-
function createMatrixMonitorSyncLifecycle(params) {
|
|
4086
|
-
let fatalError = null;
|
|
4087
|
-
let resolveFatalWait = null;
|
|
4088
|
-
let rejectFatalWait = null;
|
|
4089
|
-
const settleFatal = (error) => {
|
|
4090
|
-
if (fatalError) return;
|
|
4091
|
-
fatalError = error;
|
|
4092
|
-
rejectFatalWait?.(error);
|
|
4093
|
-
resolveFatalWait = null;
|
|
4094
|
-
rejectFatalWait = null;
|
|
4095
|
-
};
|
|
4096
|
-
const onSyncState = (state, _prevState, error) => {
|
|
4097
|
-
if (isMatrixTerminalSyncState(state) && !params.isStopping?.()) {
|
|
4098
|
-
const fatalErrorLocal = formatSyncLifecycleError(state, error);
|
|
4099
|
-
params.statusController.noteUnexpectedError(fatalErrorLocal);
|
|
4100
|
-
settleFatal(fatalErrorLocal);
|
|
4101
|
-
return;
|
|
4102
|
-
}
|
|
4103
|
-
if (fatalError) return;
|
|
4104
|
-
if (params.isStopping?.() && !isMatrixTerminalSyncState(state)) return;
|
|
4105
|
-
params.statusController.noteSyncState(state, error);
|
|
4106
|
-
};
|
|
4107
|
-
const onUnexpectedError = (error) => {
|
|
4108
|
-
if (params.isStopping?.()) return;
|
|
4109
|
-
params.statusController.noteUnexpectedError(error);
|
|
4110
|
-
settleFatal(error);
|
|
4111
|
-
};
|
|
4112
|
-
params.client.on("sync.state", onSyncState);
|
|
4113
|
-
params.client.on("sync.unexpected_error", onUnexpectedError);
|
|
4114
|
-
return {
|
|
4115
|
-
async waitForFatalStop() {
|
|
4116
|
-
if (fatalError) throw fatalError;
|
|
4117
|
-
if (resolveFatalWait || rejectFatalWait) throw new Error("Matrix fatal-stop wait already in progress");
|
|
4118
|
-
await new Promise((resolve, reject) => {
|
|
4119
|
-
resolveFatalWait = resolve;
|
|
4120
|
-
rejectFatalWait = (error) => reject(error);
|
|
4121
|
-
});
|
|
4122
|
-
},
|
|
4123
|
-
dispose() {
|
|
4124
|
-
resolveFatalWait?.();
|
|
4125
|
-
resolveFatalWait = null;
|
|
4126
|
-
rejectFatalWait = null;
|
|
4127
|
-
params.client.off("sync.state", onSyncState);
|
|
4128
|
-
params.client.off("sync.unexpected_error", onUnexpectedError);
|
|
4129
|
-
}
|
|
4130
|
-
};
|
|
4131
|
-
}
|
|
4132
|
-
//#endregion
|
|
4133
|
-
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
4134
|
-
function resolveMatrixStreamingMode(streaming) {
|
|
4135
|
-
const mode = streaming?.mode;
|
|
4136
|
-
if (mode === "partial" || mode === "quiet" || mode === "progress") return mode;
|
|
4137
|
-
return "off";
|
|
4138
|
-
}
|
|
4139
|
-
function resolveMatrixPreviewToolProgress(streaming) {
|
|
4140
|
-
if (!streaming) return true;
|
|
4141
|
-
if (resolveMatrixStreamingMode(streaming) === "progress") return streaming.progress?.toolProgress ?? streaming.preview?.toolProgress ?? false;
|
|
4142
|
-
return streaming.preview?.toolProgress ?? true;
|
|
4143
|
-
}
|
|
4144
|
-
function resolveMatrixPreviewToolProgressEnabled(streaming) {
|
|
4145
|
-
return resolveMatrixStreamingMode(streaming) !== "off" && resolveMatrixPreviewToolProgress(streaming);
|
|
4146
|
-
}
|
|
4147
|
-
const DEFAULT_MEDIA_MAX_MB = 20;
|
|
4148
|
-
async function monitorMatrixProvider(opts = {}) {
|
|
4149
|
-
if (opts.abortSignal?.aborted) return;
|
|
4150
|
-
const core = getMatrixRuntime();
|
|
4151
|
-
let cfg = core.config.current();
|
|
4152
|
-
if (cfg.channels?.["matrix"]?.enabled === false) return;
|
|
4153
|
-
const logger = core.logging.getChildLogger({ module: "matrix-auto-reply" });
|
|
4154
|
-
const formatRuntimeMessage = (...args) => format(...args);
|
|
4155
|
-
const runtime = opts.runtime ?? {
|
|
4156
|
-
log: (...args) => {
|
|
4157
|
-
logger.info(formatRuntimeMessage(...args));
|
|
4158
|
-
},
|
|
4159
|
-
error: (...args) => {
|
|
4160
|
-
logger.error(formatRuntimeMessage(...args));
|
|
4161
|
-
},
|
|
4162
|
-
exit: (code) => {
|
|
4163
|
-
throw new Error(`exit ${code}`);
|
|
4164
|
-
}
|
|
4165
|
-
};
|
|
4166
|
-
const logVerboseMessage = (message) => {
|
|
4167
|
-
if (!core.logging.shouldLogVerbose()) return;
|
|
4168
|
-
logger.debug?.(message);
|
|
4169
|
-
};
|
|
4170
|
-
const effectiveAccountId = resolveMatrixAuthContext({
|
|
4171
|
-
cfg,
|
|
4172
|
-
accountId: opts.accountId
|
|
4173
|
-
}).accountId;
|
|
4174
|
-
const accountConfig = resolveMatrixAccountConfig({
|
|
4175
|
-
cfg,
|
|
4176
|
-
accountId: effectiveAccountId
|
|
4177
|
-
});
|
|
4178
|
-
const allowlistOnly = accountConfig.allowlistOnly === true;
|
|
4179
|
-
const accountAllowBots = accountConfig.allowBots;
|
|
4180
|
-
let roomsConfig = accountConfig.groups ?? accountConfig.rooms;
|
|
4181
|
-
let needsRoomAliasesForConfig = false;
|
|
4182
|
-
const initialAllowFrom = (accountConfig.dm?.allowFrom ?? []).map(String);
|
|
4183
|
-
const initialGroupAllowFrom = (accountConfig.groupAllowFrom ?? []).map(String);
|
|
4184
|
-
const { allowFrom, allowFromResolvedEntries, groupAllowFrom, groupAllowFromResolvedEntries, roomsConfig: resolvedRoomsConfig } = await resolveMatrixMonitorConfig({
|
|
4185
|
-
cfg,
|
|
4186
|
-
accountId: effectiveAccountId,
|
|
4187
|
-
allowFrom: initialAllowFrom,
|
|
4188
|
-
groupAllowFrom: initialGroupAllowFrom,
|
|
4189
|
-
roomsConfig,
|
|
4190
|
-
runtime
|
|
4191
|
-
});
|
|
4192
|
-
roomsConfig = resolvedRoomsConfig;
|
|
4193
|
-
needsRoomAliasesForConfig = Boolean(roomsConfig && Object.keys(roomsConfig).some((key) => key.trim().startsWith("#")));
|
|
4194
|
-
cfg = {
|
|
4195
|
-
...cfg,
|
|
4196
|
-
channels: {
|
|
4197
|
-
...cfg.channels,
|
|
4198
|
-
matrix: {
|
|
4199
|
-
...cfg.channels?.["matrix"],
|
|
4200
|
-
dm: {
|
|
4201
|
-
...cfg.channels?.["matrix"]?.dm,
|
|
4202
|
-
allowFrom
|
|
4203
|
-
},
|
|
4204
|
-
groupAllowFrom,
|
|
4205
|
-
...roomsConfig ? { groups: roomsConfig } : {}
|
|
4206
|
-
}
|
|
4207
|
-
}
|
|
4208
|
-
};
|
|
4209
|
-
const auth = await resolveMatrixAuth({
|
|
4210
|
-
cfg,
|
|
4211
|
-
accountId: effectiveAccountId
|
|
4212
|
-
});
|
|
4213
|
-
if (opts.abortSignal?.aborted) return;
|
|
4214
|
-
const configuredBotUserIds = await resolveConfiguredMatrixBotUserIds({
|
|
4215
|
-
cfg,
|
|
4216
|
-
accountId: effectiveAccountId,
|
|
4217
|
-
abortSignal: opts.abortSignal
|
|
4218
|
-
});
|
|
4219
|
-
if (opts.abortSignal?.aborted) return;
|
|
4220
|
-
const resolvedInitialSyncLimit = resolveOptionalIntegerOption(opts.initialSyncLimit, { min: 0 }) ?? auth.initialSyncLimit;
|
|
4221
|
-
const authWithLimit = resolvedInitialSyncLimit === auth.initialSyncLimit ? auth : {
|
|
4222
|
-
...auth,
|
|
4223
|
-
initialSyncLimit: resolvedInitialSyncLimit
|
|
4224
|
-
};
|
|
4225
|
-
const statusController = createMatrixMonitorStatusController({
|
|
4226
|
-
accountId: auth.accountId,
|
|
4227
|
-
baseUrl: auth.homeserver,
|
|
4228
|
-
statusSink: opts.setStatus
|
|
4229
|
-
});
|
|
4230
|
-
let cleanedUp = false;
|
|
4231
|
-
let cleanupPromise = null;
|
|
4232
|
-
let client = null;
|
|
4233
|
-
let clientLease = null;
|
|
4234
|
-
let monitorLifecycleSignal = opts.abortSignal;
|
|
4235
|
-
let threadBindingManager = null;
|
|
4236
|
-
const monitorTaskRunner = createMatrixMonitorTaskRunner({
|
|
4237
|
-
logger,
|
|
4238
|
-
logVerboseMessage
|
|
4239
|
-
});
|
|
4240
|
-
let disposeAutoJoin = () => {};
|
|
4241
|
-
let disposeMonitorEvents = () => {};
|
|
4242
|
-
let syncLifecycle = null;
|
|
4243
|
-
let monitorSetupClosed = false;
|
|
4244
|
-
const cleanup = (mode = "persist") => {
|
|
4245
|
-
if (cleanupPromise) return cleanupPromise;
|
|
4246
|
-
cleanedUp = true;
|
|
4247
|
-
cleanupPromise = (async () => {
|
|
4248
|
-
try {
|
|
4249
|
-
await clientLease?.release({ mode });
|
|
4250
|
-
} finally {
|
|
4251
|
-
statusController.markStopped();
|
|
4252
|
-
}
|
|
4253
|
-
})();
|
|
4254
|
-
return cleanupPromise;
|
|
4255
|
-
};
|
|
4256
|
-
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
4257
|
-
const { groupPolicy: groupPolicyRaw, providerMissingFallbackApplied } = resolveAllowlistProviderRuntimeGroupPolicy({
|
|
4258
|
-
providerConfigPresent: cfg.channels?.["matrix"] !== void 0,
|
|
4259
|
-
groupPolicy: accountConfig.groupPolicy,
|
|
4260
|
-
defaultGroupPolicy
|
|
4261
|
-
});
|
|
4262
|
-
warnMissingProviderGroupPolicyFallbackOnce({
|
|
4263
|
-
providerMissingFallbackApplied,
|
|
4264
|
-
providerKey: "matrix",
|
|
4265
|
-
accountId: effectiveAccountId,
|
|
4266
|
-
blockedLabel: GROUP_POLICY_BLOCKED_LABEL.room,
|
|
4267
|
-
log: (message) => logVerboseMessage(message)
|
|
4268
|
-
});
|
|
4269
|
-
const groupPolicy = allowlistOnly && groupPolicyRaw === "open" ? "allowlist" : groupPolicyRaw;
|
|
4270
|
-
const replyToMode = opts.replyToMode ?? accountConfig.replyToMode ?? "off";
|
|
4271
|
-
const threadReplies = accountConfig.threadReplies ?? "inbound";
|
|
4272
|
-
const dmThreadReplies = accountConfig.dm?.threadReplies;
|
|
4273
|
-
const threadBindingIdleTimeoutMs = resolveThreadBindingIdleTimeoutMsForChannel({
|
|
4274
|
-
cfg,
|
|
4275
|
-
channel: "matrix",
|
|
4276
|
-
accountId: effectiveAccountId
|
|
4277
|
-
});
|
|
4278
|
-
const threadBindingMaxAgeMs = resolveThreadBindingMaxAgeMsForChannel({
|
|
4279
|
-
cfg,
|
|
4280
|
-
channel: "matrix",
|
|
4281
|
-
accountId: effectiveAccountId
|
|
4282
|
-
});
|
|
4283
|
-
const dmConfig = accountConfig.dm;
|
|
4284
|
-
const dmEnabled = dmConfig?.enabled ?? true;
|
|
4285
|
-
const dmPolicyRaw = dmConfig?.policy ?? "pairing";
|
|
4286
|
-
const dmPolicy = allowlistOnly && dmPolicyRaw !== "disabled" ? "allowlist" : dmPolicyRaw;
|
|
4287
|
-
const dmSessionScope = dmConfig?.sessionScope ?? "per-user";
|
|
4288
|
-
const globalGroupChatHistoryLimit = cfg.messages?.groupChat?.historyLimit;
|
|
4289
|
-
const historyLimit = resolvePromptHistoryLimit(accountConfig.historyLimit ?? globalGroupChatHistoryLimit, 0);
|
|
4290
|
-
const mediaMaxMb = opts.mediaMaxMb ?? accountConfig.mediaMaxMb ?? DEFAULT_MEDIA_MAX_MB;
|
|
4291
|
-
const mediaMaxBytes = Math.max(1, mediaMaxMb) * 1024 * 1024;
|
|
4292
|
-
const streaming = resolveMatrixStreamingMode(accountConfig.streaming);
|
|
4293
|
-
const previewToolProgressEnabled = resolveMatrixPreviewToolProgressEnabled(accountConfig.streaming);
|
|
4294
|
-
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(accountConfig) === true;
|
|
4295
|
-
const startupMs = Date.now();
|
|
4296
|
-
const startupGraceMs = 0;
|
|
4297
|
-
const warnedEncryptedRooms = /* @__PURE__ */ new Set();
|
|
4298
|
-
const warnedCryptoMissingRooms = /* @__PURE__ */ new Set();
|
|
4299
|
-
let healthySyncSinceMs;
|
|
4300
|
-
const noteSyncHealthState = (state, at = Date.now()) => {
|
|
4301
|
-
if (isMatrixReadySyncState(state)) {
|
|
4302
|
-
healthySyncSinceMs ??= at;
|
|
4303
|
-
return;
|
|
4304
|
-
}
|
|
4305
|
-
if (isMatrixDisconnectedSyncState(state)) healthySyncSinceMs = void 0;
|
|
4306
|
-
};
|
|
4307
|
-
const onSyncState = (state) => {
|
|
4308
|
-
noteSyncHealthState(state);
|
|
4309
|
-
};
|
|
4310
|
-
const monitorRetirement = {
|
|
4311
|
-
closeTaskAdmission: () => {
|
|
4312
|
-
monitorSetupClosed = true;
|
|
4313
|
-
monitorTaskRunner.close();
|
|
4314
|
-
},
|
|
4315
|
-
detachListeners: () => {
|
|
4316
|
-
disposeAutoJoin();
|
|
4317
|
-
disposeMonitorEvents();
|
|
4318
|
-
client?.off("sync.state", onSyncState);
|
|
4319
|
-
syncLifecycle?.dispose();
|
|
4320
|
-
},
|
|
4321
|
-
waitForTasks: monitorTaskRunner.waitForIdle,
|
|
4322
|
-
cleanup: () => threadBindingManager?.stop()
|
|
4323
|
-
};
|
|
4324
|
-
try {
|
|
4325
|
-
clientLease = await acquireSharedMatrixClient({
|
|
4326
|
-
cfg,
|
|
4327
|
-
auth: authWithLimit,
|
|
4328
|
-
startClient: false,
|
|
4329
|
-
accountId: auth.accountId,
|
|
4330
|
-
abortSignal: opts.abortSignal,
|
|
4331
|
-
role: "monitor"
|
|
4332
|
-
});
|
|
4333
|
-
client = clientLease.client;
|
|
4334
|
-
monitorLifecycleSignal = opts.abortSignal ? AbortSignal.any([opts.abortSignal, clientLease.abortSignal]) : clientLease.abortSignal;
|
|
4335
|
-
clientLease.registerMonitorRetirement(monitorRetirement);
|
|
4336
|
-
const inboundDeduper = createMatrixInboundEventDeduper({
|
|
4337
|
-
auth,
|
|
4338
|
-
env: process.env
|
|
4339
|
-
});
|
|
4340
|
-
syncLifecycle = createMatrixMonitorSyncLifecycle({
|
|
4341
|
-
client,
|
|
4342
|
-
statusController,
|
|
4343
|
-
isStopping: () => cleanedUp || monitorLifecycleSignal?.aborted === true
|
|
4344
|
-
});
|
|
4345
|
-
client.on("sync.state", onSyncState);
|
|
4346
|
-
const dropPreStartupMessages = !client.hasPersistedSyncState();
|
|
4347
|
-
const { getRoomInfo, getMemberDisplayName, invalidateMemberDisplayName } = createMatrixRoomInfoResolver(client);
|
|
4348
|
-
const isExplicitlyConfiguredRoom = async (roomId) => {
|
|
4349
|
-
const roomInfoForConfig = needsRoomAliasesForConfig ? await getRoomInfo(roomId, { includeAliases: true }) : void 0;
|
|
4350
|
-
const aliases = roomInfoForConfig ? [roomInfoForConfig.canonicalAlias ?? "", ...roomInfoForConfig.altAliases].filter(Boolean) : [];
|
|
4351
|
-
return resolveMatrixRoomConfig({
|
|
4352
|
-
rooms: roomsConfig,
|
|
4353
|
-
roomId,
|
|
4354
|
-
aliases
|
|
4355
|
-
}).matchSource === "direct";
|
|
4356
|
-
};
|
|
4357
|
-
const directTracker = createDirectRoomTracker(client, {
|
|
4358
|
-
log: logVerboseMessage,
|
|
4359
|
-
isExplicitlyConfiguredRoom,
|
|
4360
|
-
canPromoteRecentInvite: async (roomId) => shouldPromoteRecentInviteRoom({
|
|
4361
|
-
roomId,
|
|
4362
|
-
roomInfo: await getRoomInfo(roomId, { includeAliases: true }),
|
|
4363
|
-
rooms: roomsConfig
|
|
4364
|
-
}),
|
|
4365
|
-
...dmSessionScope === "per-room" ? { canPromoteUnmappedStrictRoom: async (roomId) => shouldPromoteRecentInviteRoom({
|
|
4366
|
-
roomId,
|
|
4367
|
-
roomInfo: await getRoomInfo(roomId, { includeAliases: true }),
|
|
4368
|
-
rooms: roomsConfig
|
|
4369
|
-
}) } : {},
|
|
4370
|
-
shouldKeepLocallyPromotedDirectRoom: async (roomId) => {
|
|
4371
|
-
try {
|
|
4372
|
-
const roomInfo = await getRoomInfo(roomId, { includeAliases: true });
|
|
4373
|
-
if (!roomInfo.nameResolved || !roomInfo.aliasesResolved) return;
|
|
4374
|
-
return shouldPromoteRecentInviteRoom({
|
|
4375
|
-
roomId,
|
|
4376
|
-
roomInfo,
|
|
4377
|
-
rooms: roomsConfig
|
|
4378
|
-
});
|
|
4379
|
-
} catch (err) {
|
|
4380
|
-
logVerboseMessage(`matrix: local promotion revalidation failed room=${roomId} (${String(err)})`);
|
|
4381
|
-
return;
|
|
4382
|
-
}
|
|
4383
|
-
}
|
|
4384
|
-
});
|
|
4385
|
-
disposeAutoJoin = registerMatrixAutoJoin({
|
|
4386
|
-
client,
|
|
4387
|
-
accountConfig,
|
|
4388
|
-
runtime,
|
|
4389
|
-
runDetachedTask: monitorTaskRunner.runDetachedTask
|
|
4390
|
-
});
|
|
4391
|
-
const handleRoomMessage = createMatrixRoomMessageHandler({
|
|
4392
|
-
client,
|
|
4393
|
-
core,
|
|
4394
|
-
cfg,
|
|
4395
|
-
accountId: effectiveAccountId,
|
|
4396
|
-
accountConfig,
|
|
4397
|
-
runtime,
|
|
4398
|
-
logger,
|
|
4399
|
-
logVerboseMessage,
|
|
4400
|
-
allowFrom,
|
|
4401
|
-
allowFromResolvedEntries,
|
|
4402
|
-
groupAllowFrom,
|
|
4403
|
-
groupAllowFromResolvedEntries,
|
|
4404
|
-
roomsConfig,
|
|
4405
|
-
accountAllowBots,
|
|
4406
|
-
configuredBotUserIds,
|
|
4407
|
-
groupPolicy,
|
|
4408
|
-
replyToMode,
|
|
4409
|
-
threadReplies,
|
|
4410
|
-
dmThreadReplies,
|
|
4411
|
-
dmSessionScope,
|
|
4412
|
-
streaming,
|
|
4413
|
-
previewToolProgressEnabled,
|
|
4414
|
-
blockStreamingEnabled,
|
|
4415
|
-
dmEnabled,
|
|
4416
|
-
dmPolicy,
|
|
4417
|
-
mediaMaxBytes,
|
|
4418
|
-
historyLimit,
|
|
4419
|
-
startupMs,
|
|
4420
|
-
startupGraceMs,
|
|
4421
|
-
dropPreStartupMessages,
|
|
4422
|
-
inboundDeduper,
|
|
4423
|
-
directTracker,
|
|
4424
|
-
getRoomInfo,
|
|
4425
|
-
getMemberDisplayName,
|
|
4426
|
-
needsRoomAliasesForConfig
|
|
4427
|
-
});
|
|
4428
|
-
const createdThreadBindingManager = await createMatrixThreadBindingManager({
|
|
4429
|
-
cfg,
|
|
4430
|
-
accountId: effectiveAccountId,
|
|
4431
|
-
auth,
|
|
4432
|
-
client,
|
|
4433
|
-
env: process.env,
|
|
4434
|
-
idleTimeoutMs: threadBindingIdleTimeoutMs,
|
|
4435
|
-
maxAgeMs: threadBindingMaxAgeMs,
|
|
4436
|
-
logVerboseMessage
|
|
4437
|
-
});
|
|
4438
|
-
if (monitorSetupClosed) {
|
|
4439
|
-
await createdThreadBindingManager.stop();
|
|
4440
|
-
await cleanup("stop");
|
|
4441
|
-
return;
|
|
4442
|
-
}
|
|
4443
|
-
threadBindingManager = createdThreadBindingManager;
|
|
4444
|
-
logVerboseMessage(`matrix: thread bindings ready account=${threadBindingManager.accountId} idleMs=${threadBindingIdleTimeoutMs} maxAgeMs=${threadBindingMaxAgeMs}`);
|
|
4445
|
-
disposeMonitorEvents = registerMatrixMonitorEvents({
|
|
4446
|
-
cfg,
|
|
4447
|
-
client,
|
|
4448
|
-
auth,
|
|
4449
|
-
allowFrom,
|
|
4450
|
-
dmEnabled,
|
|
4451
|
-
dmPolicy,
|
|
4452
|
-
readStoreAllowFrom: async () => await core.channel.pairing.readAllowFromStore({
|
|
4453
|
-
channel: "matrix",
|
|
4454
|
-
env: process.env,
|
|
4455
|
-
accountId: effectiveAccountId
|
|
4456
|
-
}).catch(() => []),
|
|
4457
|
-
directTracker,
|
|
4458
|
-
groupPolicy,
|
|
4459
|
-
roomsConfig,
|
|
4460
|
-
needsRoomAliasesForConfig,
|
|
4461
|
-
getRoomInfo,
|
|
4462
|
-
invalidateMemberDisplayName,
|
|
4463
|
-
logVerboseMessage,
|
|
4464
|
-
warnedEncryptedRooms,
|
|
4465
|
-
warnedCryptoMissingRooms,
|
|
4466
|
-
logger,
|
|
4467
|
-
startupGraceMs,
|
|
4468
|
-
getHealthySyncSinceMs: () => healthySyncSinceMs,
|
|
4469
|
-
formatNativeDependencyHint: core.system.formatNativeDependencyHint,
|
|
4470
|
-
onRoomMessage: handleRoomMessage,
|
|
4471
|
-
runDetachedTask: monitorTaskRunner.runDetachedTask
|
|
4472
|
-
});
|
|
4473
|
-
logVerboseMessage("matrix: starting client");
|
|
4474
|
-
await clientLease.start(monitorLifecycleSignal);
|
|
4475
|
-
if (monitorSetupClosed) {
|
|
4476
|
-
await cleanup("stop");
|
|
4477
|
-
return;
|
|
4478
|
-
}
|
|
4479
|
-
logVerboseMessage("matrix: client started");
|
|
4480
|
-
logger.info(`matrix: logged in as ${auth.userId}`);
|
|
4481
|
-
monitorTaskRunner.runDetachedTask("deviceId backfill", async () => {
|
|
4482
|
-
const taskSignal = getMatrixMonitorTaskSignal();
|
|
4483
|
-
await backfillMatrixAuthDeviceIdAfterStartup({
|
|
4484
|
-
auth,
|
|
4485
|
-
env: process.env,
|
|
4486
|
-
abortSignal: taskSignal && monitorLifecycleSignal ? AbortSignal.any([taskSignal, monitorLifecycleSignal]) : taskSignal ?? monitorLifecycleSignal
|
|
4487
|
-
});
|
|
4488
|
-
});
|
|
4489
|
-
registerChannelRuntimeContext({
|
|
4490
|
-
channelRuntime: opts.channelRuntime,
|
|
4491
|
-
channelId: "matrix",
|
|
4492
|
-
accountId: effectiveAccountId,
|
|
4493
|
-
capability: CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY,
|
|
4494
|
-
context: { client },
|
|
4495
|
-
abortSignal: monitorLifecycleSignal
|
|
4496
|
-
});
|
|
4497
|
-
await runMatrixStartupMaintenance({
|
|
4498
|
-
client,
|
|
4499
|
-
auth,
|
|
4500
|
-
accountId: effectiveAccountId,
|
|
4501
|
-
effectiveAccountId,
|
|
4502
|
-
accountConfig,
|
|
4503
|
-
logger,
|
|
4504
|
-
logVerboseMessage,
|
|
4505
|
-
getRuntimeConfig: () => core.config.current(),
|
|
4506
|
-
replaceConfigFile: async (nextCfg) => {
|
|
4507
|
-
await core.config.replaceConfigFile({
|
|
4508
|
-
nextConfig: nextCfg,
|
|
4509
|
-
afterWrite: { mode: "auto" }
|
|
4510
|
-
});
|
|
4511
|
-
},
|
|
4512
|
-
loadWebMedia: async (url, maxBytes) => await core.media.loadWebMedia(url, maxBytes),
|
|
4513
|
-
env: process.env,
|
|
4514
|
-
abortSignal: monitorLifecycleSignal
|
|
4515
|
-
});
|
|
4516
|
-
if (monitorSetupClosed) {
|
|
4517
|
-
await cleanup("stop");
|
|
4518
|
-
return;
|
|
4519
|
-
}
|
|
4520
|
-
await Promise.race([waitUntilAbort(monitorLifecycleSignal, async () => {
|
|
4521
|
-
try {
|
|
4522
|
-
logVerboseMessage("matrix: stopping client");
|
|
4523
|
-
await cleanup();
|
|
4524
|
-
} catch (err) {
|
|
4525
|
-
logger.warn("matrix: failed during monitor shutdown cleanup", { error: String(err) });
|
|
4526
|
-
}
|
|
4527
|
-
}), syncLifecycle.waitForFatalStop()]);
|
|
4528
|
-
await cleanup();
|
|
4529
|
-
} catch (err) {
|
|
4530
|
-
if (monitorSetupClosed) {
|
|
4531
|
-
await cleanup("stop");
|
|
4532
|
-
return;
|
|
4533
|
-
}
|
|
4534
|
-
if (monitorLifecycleSignal?.aborted === true && isMatrixStartupAbortError(err)) {
|
|
4535
|
-
await cleanup("stop");
|
|
4536
|
-
return;
|
|
4537
|
-
}
|
|
4538
|
-
statusController.noteUnexpectedError(err);
|
|
4539
|
-
await cleanup();
|
|
4540
|
-
throw err;
|
|
4541
|
-
}
|
|
4542
|
-
}
|
|
4543
|
-
//#endregion
|
|
4544
|
-
export { monitorMatrixProvider };
|