@openclaw/matrix 2026.9.8 → 2026.10.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-selection-B7axQ80R.mjs → account-selection-BDeeqwwR.mjs} +1 -1
- package/dist/.setup/{accounts-WkgrIxMt.mjs → accounts-C_r0UlEm.mjs} +2 -2
- package/dist/.setup/{approval-handler.runtime-C-pw3NvY.mjs → approval-handler.runtime-QkHLH2az.mjs} +14 -19
- package/dist/.setup/{approval-reactions-BrS5ECU0.mjs → approval-reactions-DhB6gNPU.mjs} +11 -25
- package/dist/.setup/{channel-DXenXmj0.mjs → channel-CeRXEAEP.mjs} +17 -46
- package/dist/.setup/{channel.runtime-BXUawOno.mjs → channel.runtime-DBQA2y1F.mjs} +6 -6
- package/dist/.setup/{channel.setup-DWfLaXqT.mjs → channel.setup-DC2t7_PK.mjs} +12 -26
- package/dist/.setup/{cli-IhZO2OEj.mjs → cli-Be8tdNw8.mjs} +24 -45
- package/dist/.setup/{cli-metadata-nowEgdY0.mjs → cli-metadata-CtcjBFhc.mjs} +1 -1
- package/dist/.setup/{client-BXATebyo.mjs → client-DY3HExqI.mjs} +3 -3
- package/dist/.setup/{client-bootstrap-BiHX55is.mjs → client-bootstrap-CZvJjr29.mjs} +1 -1
- package/dist/.setup/{client-Ccv77kwh.mjs → client-kmih04ng.mjs} +21 -40
- package/dist/.setup/{client-support-Bn9Bk0-H.mjs → client-support-D7BlioUb.mjs} +14 -23
- package/dist/.setup/{config-update-5m1Un5gJ.mjs → config-update-CZndPxNd.mjs} +29 -72
- package/dist/.setup/{create-client-DRZ580E3.mjs → create-client-CbJVyFDy.mjs} +5 -5
- package/dist/.setup/{credentials-C9qDO5-2.mjs → credentials-C2dvc_kB.mjs} +1 -1
- package/dist/.setup/{credentials-read-KD4o5biZ.mjs → credentials-read-CqRiEAQa.mjs} +1 -1
- package/dist/.setup/{crypto-runtime-DPjIDF8H.mjs → crypto-runtime-B2AjWo-i.mjs} +223 -79
- package/dist/.setup/{deps-CLQ4EOq7.mjs → deps-CFNl7tQo.mjs} +14 -39
- package/dist/.setup/{device-health-U-yoVjPw.mjs → device-health-Be60VF1w.mjs} +1 -1
- package/dist/.setup/{direct-management-Cn2t8n1V.mjs → direct-management-DJtQhLKH.mjs} +4 -8
- package/dist/.setup/{directory-live-_sw-Q7KO.mjs → directory-live-DW5UykLL.mjs} +3 -3
- package/dist/.setup/{doctor-contract-De6geW0h.mjs → doctor-contract-CsTNmbMa.mjs} +10 -133
- package/dist/.setup/{draft-stream-CdVMstpR.mjs → draft-stream-B87DfA6a.mjs} +4 -8
- package/dist/.setup/{encryption-guidance-B6797jNA.mjs → encryption-guidance-BEjKbiMR.mjs} +1 -1
- package/dist/.setup/{exec-approvals-fsiMQ1ce.mjs → exec-approvals-BLDAMyHs.mjs} +6 -19
- package/dist/.setup/{file-sync-store-B-9bMb_O.mjs → file-sync-store-Clc9iEdn.mjs} +3 -3
- package/dist/.setup/{http-client-C1XvVD3K.mjs → http-client-DfJY5Ck0.mjs} +8 -29
- package/dist/.setup/{inbound-dedupe-BGrMrTTu.mjs → inbound-dedupe-C-EBGY0B.mjs} +1 -1
- package/dist/.setup/{joined-room-encryption-TZoOKXgh.mjs → joined-room-encryption-BAD70N5n.mjs} +1 -1
- package/dist/.setup/logger-CXQnpXCt.mjs +44 -0
- package/dist/.setup/{logging-mhnFQGzB.mjs → logging-BKV8TYQq.mjs} +7 -32
- package/dist/.setup/{messages-Buz27pi5.mjs → messages-uCbwLRKS.mjs} +5 -8
- package/dist/.setup/{monitor-BBg5qgov.mjs → monitor-skIntQVG.mjs} +109 -180
- package/dist/.setup/{onboarding-hJaieQj5.mjs → onboarding-Cm_tOJxs.mjs} +12 -19
- package/dist/.setup/{outbound-C9vBijaH.mjs → outbound-CqQou3ny.mjs} +16 -22
- package/dist/.setup/{profile-B3DD2jYa.mjs → profile-DS0xdJAi.mjs} +11 -31
- package/dist/.setup/{profile-update-CmxIAd4c.mjs → profile-update-C1n8SRqH.mjs} +3 -3
- package/dist/.setup/{reaction-events-mnzc_JvP.mjs → reaction-events-Cqq46xsG.mjs} +5 -5
- package/dist/.setup/{resolve-targets-BFq3q4c9.mjs → resolve-targets-DFeU1Ww6.mjs} +2 -2
- package/dist/.setup/retired-state-BXUQ2I-C.mjs +91 -0
- package/dist/.setup/{room-info-BbTGRJcR.mjs → room-info-BPMbwe8I.mjs} +33 -50
- package/dist/.setup/{sdk-DmRVM0VA.mjs → sdk-CgQGkCsS.mjs} +226 -182
- package/dist/.setup/{send-GOF64QRc.mjs → send-B1Y2L4wj.mjs} +19 -68
- package/dist/.setup/{setup-bootstrap-AzalcuCW.mjs → setup-bootstrap-UNIGyKnk.mjs} +2 -2
- package/dist/.setup/{setup-core-BeifoeL4.mjs → setup-core-6DppLENo.mjs} +5 -5
- package/dist/.setup/{setup-plugin-api-Bsbdw41x.mjs → setup-plugin-api-BRs9bcp4.mjs} +1 -1
- package/dist/.setup/startup-verification-D00eUt74.mjs +122 -0
- package/dist/.setup/storage-D7agewjH.mjs +464 -0
- package/dist/.setup/{sync-cache-state-C6sEmvJK.mjs → sync-cache-state-C2z64uyk.mjs} +10 -24
- package/dist/.setup/{thread-bindings-jXu_9cHE.mjs → thread-bindings-DveHVZqN.mjs} +13 -71
- package/dist/.setup/{tool-actions-Ce7Okg6m.mjs → tool-actions-BqlK2ilM.mjs} +51 -73
- package/dist/.setup/{verification-C45rOZkM.mjs → verification-kMlFYUn0.mjs} +10 -27
- package/dist/api.js +5 -5
- 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 +48 -201
- package/dist/helper-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/runtime-api.js +3 -3
- 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/node_modules/@openclaw/fs-safe/CHANGELOG.md +95 -0
- package/node_modules/@openclaw/fs-safe/README.md +70 -379
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +35 -51
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +9 -10
- package/node_modules/@openclaw/fs-safe/dist/archive.js +2 -5
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +51 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +242 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/config.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/create.js +12 -5
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +4 -7
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.js +262 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/file-identity.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +4 -6
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +20 -18
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +4 -10
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +2 -10
- package/node_modules/@openclaw/fs-safe/dist/fs.js +2 -10
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +3 -4
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +6 -18
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +0 -2
- package/node_modules/@openclaw/fs-safe/dist/guest.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/index.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +1 -5
- package/node_modules/@openclaw/fs-safe/dist/json.js +19 -37
- package/node_modules/@openclaw/fs-safe/dist/move-path.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +9 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +47 -2
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +1 -9
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +6 -40
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +5 -2
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +11 -316
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +7 -7
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +28 -175
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.js +418 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +9 -4
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +17 -13
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +6 -24
- package/node_modules/@openclaw/fs-safe/dist/native.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/path-case.js +10 -9
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/path.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +1 -3
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +9 -10
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +4 -3
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +3 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +18 -32
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +5 -17
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +92 -230
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +4 -15
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +22 -63
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +9 -34
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +78 -83
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +18 -20
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +64 -98
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +16 -33
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +61 -200
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +76 -216
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +14 -24
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +1 -4
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +4 -19
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +52 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +350 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +2 -27
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +31 -28
- package/node_modules/@openclaw/fs-safe/dist/root-directory.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.js +9 -21
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +105 -37
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +7 -2
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +67 -38
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +0 -2
- package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +2 -3
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +68 -85
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +6 -1
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +4 -9
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.js +311 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +1 -3
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +3 -3
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +8 -10
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +0 -4
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +12 -9
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +0 -2
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +7 -4
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +13 -6
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +0 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +5 -23
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +11 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +1 -8
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +2 -9
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/trash.js +6 -2
- package/node_modules/@openclaw/fs-safe/dist/walk.js +100 -46
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +235 -19
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +21 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +21 -3
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +111 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +27 -4
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.js +131 -40
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +24 -6
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +51 -0
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +4 -1
- package/node_modules/@openclaw/fs-safe/docs/config.md +6 -14
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +4 -14
- package/node_modules/@openclaw/fs-safe/docs/durability.md +6 -29
- package/node_modules/@openclaw/fs-safe/docs/entry-publication.md +146 -0
- package/node_modules/@openclaw/fs-safe/docs/errors.md +16 -0
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +28 -5
- package/node_modules/@openclaw/fs-safe/docs/index.md +2 -31
- package/node_modules/@openclaw/fs-safe/docs/install.md +10 -31
- package/node_modules/@openclaw/fs-safe/docs/json.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/local-roots.md +0 -1
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +12 -12
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +35 -96
- package/node_modules/@openclaw/fs-safe/docs/native.md +22 -20
- package/node_modules/@openclaw/fs-safe/docs/path.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/permissions.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/reading.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/root.md +26 -184
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +115 -3
- package/node_modules/@openclaw/fs-safe/docs/store.md +2 -2
- package/node_modules/@openclaw/fs-safe/docs/temp.md +29 -65
- package/node_modules/@openclaw/fs-safe/docs/testing.md +90 -58
- package/node_modules/@openclaw/fs-safe/docs/types.md +3 -16
- package/node_modules/@openclaw/fs-safe/docs/walk.md +33 -5
- package/node_modules/@openclaw/fs-safe/docs/watch.md +96 -14
- package/node_modules/@openclaw/fs-safe/docs/writing.md +172 -16
- package/node_modules/@openclaw/fs-safe/package.json +10 -10
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/openclaw.plugin.json +0 -9
- package/package.json +5 -5
- package/dist/.setup/crypto-snapshot-doctor.runtime-44FrCPR7.mjs +0 -91
- package/dist/.setup/doctor-DMvEBx6o.mjs +0 -49
- package/dist/.setup/idb-persistence-DBvfre1X.mjs +0 -227
- package/dist/.setup/idb-persistence-lock-D_mDu4Cf.mjs +0 -27
- package/dist/.setup/logger-CVv56jzH.mjs +0 -74
- package/dist/.setup/startup-verification-Aiy_xVdI.mjs +0 -204
- package/dist/.setup/storage-BXS2cB2i.mjs +0 -288
- package/dist/.setup/storage-metadata-BDRZ7vpX.mjs +0 -371
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.d.ts +0 -6
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.js +0 -88
- package/node_modules/@openclaw/fs-safe/docs/mutation-policy-proof.md +0 -69
- package/node_modules/@openclaw/fs-safe/docs/private-file-store.md +0 -68
- package/node_modules/@openclaw/fs-safe/docs/test-hooks.md +0 -110
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
1
|
+
import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
|
|
2
2
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
3
3
|
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
4
4
|
import { i as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
5
5
|
import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-C2rMVVIQ.mjs";
|
|
6
|
-
import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-
|
|
6
|
+
import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-DJtQhLKH.mjs";
|
|
7
7
|
import { n as getMatrixEventProjection } from "./event-helpers-CspuhE9k.mjs";
|
|
8
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -23,7 +23,7 @@ import MarkdownIt from "markdown-it";
|
|
|
23
23
|
import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
|
|
24
24
|
import { parseBuffer } from "music-metadata";
|
|
25
25
|
//#region extensions/matrix/src/matrix/send/client.ts
|
|
26
|
-
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-
|
|
26
|
+
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-CZvJjr29.mjs"));
|
|
27
27
|
function resolveMediaMaxBytes(accountId, cfg) {
|
|
28
28
|
if (!cfg) throw new Error("Matrix media limits requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
29
29
|
const resolvedCfg = requireRuntimeConfig(cfg, "Matrix media limits");
|
|
@@ -449,26 +449,12 @@ function parsePollStart(content) {
|
|
|
449
449
|
maxSelections: Math.min(Math.max(maxSelections, 1), answers.length)
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function parsePollStartContent(content) {
|
|
453
|
-
const parsed = parsePollStart(content);
|
|
454
|
-
if (!parsed) return null;
|
|
455
|
-
return {
|
|
456
|
-
eventId: "",
|
|
457
|
-
roomId: "",
|
|
458
|
-
sender: "",
|
|
459
|
-
senderName: "",
|
|
460
|
-
question: parsed.question,
|
|
461
|
-
answers: parsed.answers.map((answer) => answer.text),
|
|
462
|
-
kind: parsed.kind,
|
|
463
|
-
maxSelections: parsed.maxSelections
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
452
|
function formatPollAsText(summary) {
|
|
467
453
|
return [
|
|
468
454
|
"[Poll]",
|
|
469
455
|
summary.question,
|
|
470
456
|
"",
|
|
471
|
-
...summary.answers.map((answer, idx) => `${idx + 1}. ${answer}`)
|
|
457
|
+
...summary.answers.map((answer, idx) => `${idx + 1}. ${answer.text}`)
|
|
472
458
|
].join("\n");
|
|
473
459
|
}
|
|
474
460
|
function resolvePollReferenceEventId(content) {
|
|
@@ -485,8 +471,7 @@ function parsePollResponseAnswerIds(content) {
|
|
|
485
471
|
return response.answers.filter((answer) => typeof answer === "string");
|
|
486
472
|
}
|
|
487
473
|
function buildPollResultsSummary(params) {
|
|
488
|
-
const parsed =
|
|
489
|
-
if (!parsed) return null;
|
|
474
|
+
const parsed = params.poll;
|
|
490
475
|
let pollClosedAt = Number.POSITIVE_INFINITY;
|
|
491
476
|
for (const event of params.relationEvents) {
|
|
492
477
|
if (event.unsigned?.redacted_because) continue;
|
|
@@ -497,7 +482,7 @@ function buildPollResultsSummary(params) {
|
|
|
497
482
|
}
|
|
498
483
|
const answerIds = new Set(parsed.answers.map((answer) => answer.id));
|
|
499
484
|
const latestVoteBySender = /* @__PURE__ */ new Map();
|
|
500
|
-
const orderedRelationEvents =
|
|
485
|
+
const orderedRelationEvents = params.relationEvents.toSorted((left, right) => {
|
|
501
486
|
const leftTs = asFiniteNumber(left.origin_server_ts) ?? Number.POSITIVE_INFINITY;
|
|
502
487
|
const rightTs = asFiniteNumber(right.origin_server_ts) ?? Number.POSITIVE_INFINITY;
|
|
503
488
|
if (leftTs !== rightTs) return leftTs - rightTs;
|
|
@@ -521,14 +506,8 @@ function buildPollResultsSummary(params) {
|
|
|
521
506
|
for (const answerId of latestVote) voteCounts.set(answerId, (voteCounts.get(answerId) ?? 0) + 1);
|
|
522
507
|
}
|
|
523
508
|
return {
|
|
524
|
-
eventId: params.pollEventId,
|
|
525
|
-
roomId: params.roomId,
|
|
526
|
-
sender: params.sender,
|
|
527
|
-
senderName: params.senderName,
|
|
528
509
|
question: parsed.question,
|
|
529
|
-
answers: parsed.answers.map((answer) => answer.text),
|
|
530
510
|
kind: parsed.kind,
|
|
531
|
-
maxSelections: parsed.maxSelections,
|
|
532
511
|
entries: parsed.answers.map((answer) => ({
|
|
533
512
|
id: answer.id,
|
|
534
513
|
text: answer.text,
|
|
@@ -574,7 +553,7 @@ function buildPollStartContent(poll) {
|
|
|
574
553
|
...buildTextContent$1(option)
|
|
575
554
|
}));
|
|
576
555
|
const isMultiple = normalized.maxSelections > 1;
|
|
577
|
-
const fallbackText = buildPollFallbackText(normalized.question,
|
|
556
|
+
const fallbackText = buildPollFallbackText(normalized.question, normalized.options);
|
|
578
557
|
return {
|
|
579
558
|
[M_POLL_START]: {
|
|
580
559
|
question: buildTextContent$1(normalized.question),
|
|
@@ -965,8 +944,7 @@ function collectMentionCandidates(text) {
|
|
|
965
944
|
const mentions = [];
|
|
966
945
|
for (const match of text.matchAll(MENTION_PATTERN)) {
|
|
967
946
|
const raw = match[0];
|
|
968
|
-
const start = match.index
|
|
969
|
-
if (start < 0 || !raw) continue;
|
|
947
|
+
const start = match.index;
|
|
970
948
|
if (!isMentionStartBoundary(text[start - 1])) continue;
|
|
971
949
|
const candidate = buildMentionCandidate(raw, start);
|
|
972
950
|
if (!candidate) continue;
|
|
@@ -1053,11 +1031,6 @@ function createMentionLinkTokens(params) {
|
|
|
1053
1031
|
createToken(params.sample, "link_close", "a", -1)
|
|
1054
1032
|
];
|
|
1055
1033
|
}
|
|
1056
|
-
async function resolveMatrixSelfUserId(client) {
|
|
1057
|
-
const getUserId = client.getUserId;
|
|
1058
|
-
if (typeof getUserId !== "function") return null;
|
|
1059
|
-
return await Promise.resolve(getUserId.call(client)).catch(() => null);
|
|
1060
|
-
}
|
|
1061
1034
|
function mutateInlineTokensWithMentions(params) {
|
|
1062
1035
|
const nextChildren = [];
|
|
1063
1036
|
let roomMentioned = false;
|
|
@@ -1205,7 +1178,7 @@ function renderMatrixFallbackHtml(analysis) {
|
|
|
1205
1178
|
}
|
|
1206
1179
|
async function resolveMarkdownMentionState(params) {
|
|
1207
1180
|
const tokens = parseMatrixMarkdown(params.analysis, params.tableMode);
|
|
1208
|
-
const selfUserId = await
|
|
1181
|
+
const selfUserId = await params.client.getUserId().catch(() => null);
|
|
1209
1182
|
const userIds = [];
|
|
1210
1183
|
const seenUserIds = /* @__PURE__ */ new Set();
|
|
1211
1184
|
let roomMentioned = false;
|
|
@@ -1491,18 +1464,6 @@ function formatMatrixMessageText(params) {
|
|
|
1491
1464
|
if (!body) return marker;
|
|
1492
1465
|
return `${body}\n\n${marker}`;
|
|
1493
1466
|
}
|
|
1494
|
-
function formatMatrixMediaUnavailableText(params) {
|
|
1495
|
-
return formatMatrixMessageText({
|
|
1496
|
-
...params,
|
|
1497
|
-
unavailable: true
|
|
1498
|
-
}) ?? "";
|
|
1499
|
-
}
|
|
1500
|
-
function formatMatrixMediaTooLargeText(params) {
|
|
1501
|
-
return formatMatrixMessageText({
|
|
1502
|
-
...params,
|
|
1503
|
-
tooLarge: true
|
|
1504
|
-
}) ?? "";
|
|
1505
|
-
}
|
|
1506
1467
|
//#endregion
|
|
1507
1468
|
//#region extensions/matrix/src/matrix/send/edit-content.ts
|
|
1508
1469
|
const MAX_EDIT_RELATION_PAGES = 100;
|
|
@@ -1544,24 +1505,6 @@ async function resolveMatrixEditContent(params) {
|
|
|
1544
1505
|
}
|
|
1545
1506
|
//#endregion
|
|
1546
1507
|
//#region extensions/matrix/src/matrix/send/formatting.ts
|
|
1547
|
-
async function renderMatrixFormattedContent(params) {
|
|
1548
|
-
const markdown = params.markdown ?? "";
|
|
1549
|
-
const body = params.preparedBody ?? markdownToMatrixBody(markdown);
|
|
1550
|
-
if (params.includeMentions === false) return {
|
|
1551
|
-
body,
|
|
1552
|
-
html: markdownToMatrixHtml(markdown, { tableMode: params.tableMode }).trimEnd() || void 0
|
|
1553
|
-
};
|
|
1554
|
-
const { html, mentions } = await renderMarkdownToMatrixHtmlWithMentions({
|
|
1555
|
-
markdown,
|
|
1556
|
-
client: params.client,
|
|
1557
|
-
tableMode: params.tableMode
|
|
1558
|
-
});
|
|
1559
|
-
return {
|
|
1560
|
-
body,
|
|
1561
|
-
html,
|
|
1562
|
-
mentions
|
|
1563
|
-
};
|
|
1564
|
-
}
|
|
1565
1508
|
function buildTextContent(body, relation, opts = {}) {
|
|
1566
1509
|
return {
|
|
1567
1510
|
msgtype: opts.msgtype ?? MsgType.Text,
|
|
@@ -1570,7 +1513,15 @@ function buildTextContent(body, relation, opts = {}) {
|
|
|
1570
1513
|
};
|
|
1571
1514
|
}
|
|
1572
1515
|
async function enrichMatrixFormattedContent(params) {
|
|
1573
|
-
const
|
|
1516
|
+
const markdown = params.markdown ?? "";
|
|
1517
|
+
const body = params.preparedBody ?? markdownToMatrixBody(markdown);
|
|
1518
|
+
const { html, mentions } = await (params.includeMentions === false ? {
|
|
1519
|
+
html: markdownToMatrixHtml(markdown, { tableMode: params.tableMode }).trimEnd(),
|
|
1520
|
+
mentions: void 0
|
|
1521
|
+
} : renderMarkdownToMatrixHtmlWithMentions({
|
|
1522
|
+
...params,
|
|
1523
|
+
markdown
|
|
1524
|
+
}));
|
|
1574
1525
|
params.content.body = body || params.content.body;
|
|
1575
1526
|
if (mentions) params.content["m.mentions"] = mentions;
|
|
1576
1527
|
else delete params.content["m.mentions"];
|
|
@@ -2114,4 +2065,4 @@ async function reactMatrixMessage(roomId, messageId, emoji, opts = {}) {
|
|
|
2114
2065
|
});
|
|
2115
2066
|
}
|
|
2116
2067
|
//#endregion
|
|
2117
|
-
export {
|
|
2068
|
+
export { resolveMatrixRoomId as C, reconcileMatrixUnknownSend as S, isPollEventType as _, sendSingleTextMessageMatrix as a, resolvePollReferenceEventId as b, formatMatrixMessageText as c, resolveMatrixReplacementContent as d, prepareMatrixSingleText as f, formatPollResultsAsText as g, formatPollAsText as h, sendPollMatrix as i, isLikelyBareFilename as l, buildPollResultsSummary as m, reactMatrixMessage as n, sendTypingMatrix as o, buildPollResponseContent as p, sendMessageMatrix as r, send_exports as s, editMessageMatrix as t, resolveMatrixMessageAttachment as u, isPollStartType as v, setBoundedMap as w, cleanupMatrixDeliveryPlans as x, parsePollStart as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
-
import "./accounts-
|
|
3
|
-
import { n as bootstrapMatrixVerification } from "./verification-
|
|
2
|
+
import "./accounts-C_r0UlEm.mjs";
|
|
3
|
+
import { n as bootstrapMatrixVerification } from "./verification-kMlFYUn0.mjs";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
//#region extensions/matrix/src/setup-bootstrap.ts
|
|
6
6
|
async function maybeBootstrapNewEncryptedMatrixAccount(params) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
1
|
+
import { u as resolveMatrixEnvAuthReadiness } from "./account-selection-BDeeqwwR.mjs";
|
|
2
2
|
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
-
import { r as resolveDefaultMatrixAccountId } from "./accounts-
|
|
3
|
+
import { r as resolveDefaultMatrixAccountId } from "./accounts-C_r0UlEm.mjs";
|
|
4
4
|
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
|
|
5
|
-
import { n as updateMatrixAccountConfig } from "./config-update-
|
|
6
|
-
import { t as isSupportedMatrixAvatarSource } from "./profile-
|
|
5
|
+
import { n as updateMatrixAccountConfig } from "./config-update-CZndPxNd.mjs";
|
|
6
|
+
import { t as isSupportedMatrixAvatarSource } from "./profile-DS0xdJAi.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
9
9
|
import { DEFAULT_ACCOUNT_ID, addWildcardAllowFrom, applyAccountNameToChannelSection, normalizeAccountId, normalizeAllowFromEntries, normalizeSecretInputString, patchTopLevelChannelConfigSection, prepareScopedSetupConfig, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
@@ -287,7 +287,7 @@ const matrixSetupAdapter = {
|
|
|
287
287
|
input
|
|
288
288
|
}),
|
|
289
289
|
afterAccountConfigWritten: async ({ previousCfg, cfg, accountId, runtime }) => {
|
|
290
|
-
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-
|
|
290
|
+
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-UNIGyKnk.mjs");
|
|
291
291
|
await runMatrixSetupBootstrapAfterConfigWrite({
|
|
292
292
|
previousCfg,
|
|
293
293
|
cfg,
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import { o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile } from "./retired-state-BXUQ2I-C.mjs";
|
|
3
|
+
import { o as resolveMatrixStoragePaths, r as recordCurrentStorageMetaDeviceId } from "./storage-D7agewjH.mjs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
|
+
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
7
|
+
//#region extensions/matrix/src/matrix/monitor/startup-verification.ts
|
|
8
|
+
const STARTUP_VERIFICATION_STATE_FILENAME = "startup-verification.json";
|
|
9
|
+
const STARTUP_VERIFICATION_NAMESPACE = "startup-verification";
|
|
10
|
+
const STARTUP_VERIFICATION_MAX_ENTRIES = 1e3;
|
|
11
|
+
const DEFAULT_STARTUP_VERIFICATION_MODE = "if-unverified";
|
|
12
|
+
const DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS = 24;
|
|
13
|
+
const DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS = 36e5;
|
|
14
|
+
function normalizeCooldownHours(value) {
|
|
15
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS;
|
|
16
|
+
return Math.max(0, value);
|
|
17
|
+
}
|
|
18
|
+
function createStartupVerificationStore(params) {
|
|
19
|
+
return getMatrixRuntime().state.openKeyedStore({
|
|
20
|
+
namespace: STARTUP_VERIFICATION_NAMESPACE,
|
|
21
|
+
maxEntries: STARTUP_VERIFICATION_MAX_ENTRIES,
|
|
22
|
+
env: resolveMatrixSqliteStateEnv(params)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function resolveStartupVerificationTimestamp(nowMs) {
|
|
26
|
+
return timestampMsToIsoString(nowMs) ?? timestampMsToIsoString(Date.now()) ?? "1970-01-01T00:00:00.000Z";
|
|
27
|
+
}
|
|
28
|
+
function resolveStartupVerificationRetryAfterMs(params) {
|
|
29
|
+
if (!params.state || params.stateCooldownMs <= 0) return;
|
|
30
|
+
if (params.state.userId && params.verification.userId && params.state.userId !== params.verification.userId) return;
|
|
31
|
+
if (params.state.deviceId && params.verification.deviceId && params.state.deviceId !== params.verification.deviceId) return;
|
|
32
|
+
const attemptedAtMs = Date.parse(params.state.attemptedAt ?? "");
|
|
33
|
+
if (!Number.isFinite(attemptedAtMs)) return;
|
|
34
|
+
const remaining = attemptedAtMs + params.stateCooldownMs - params.nowMs;
|
|
35
|
+
return remaining > 0 ? remaining : void 0;
|
|
36
|
+
}
|
|
37
|
+
async function ensureMatrixStartupVerification(params) {
|
|
38
|
+
if (params.auth.encryption !== true || !params.client.crypto) return { kind: "unsupported" };
|
|
39
|
+
const verification = await params.client.getOwnDeviceVerificationStatus();
|
|
40
|
+
let statePath = params.stateFilePath;
|
|
41
|
+
if (statePath == null) {
|
|
42
|
+
const storagePaths = await resolveMatrixStoragePaths({
|
|
43
|
+
...params.auth,
|
|
44
|
+
env: params.env,
|
|
45
|
+
stateDir: params.stateDir
|
|
46
|
+
});
|
|
47
|
+
statePath = path.join(storagePaths.rootDir, STARTUP_VERIFICATION_STATE_FILENAME);
|
|
48
|
+
}
|
|
49
|
+
await assertMatrixSupportedStateFile(statePath);
|
|
50
|
+
const stateLocation = {
|
|
51
|
+
env: params.env,
|
|
52
|
+
stateDir: params.stateDir ?? path.dirname(statePath)
|
|
53
|
+
};
|
|
54
|
+
const stateKey = params.auth.accountId.trim() || "default";
|
|
55
|
+
const mode = params.accountConfig.startupVerification ?? DEFAULT_STARTUP_VERIFICATION_MODE;
|
|
56
|
+
if (verification.verified || mode === "off") {
|
|
57
|
+
await createStartupVerificationStore(stateLocation).delete(stateKey).catch(() => {});
|
|
58
|
+
return {
|
|
59
|
+
kind: verification.verified ? "verified" : "disabled",
|
|
60
|
+
verification
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if ((await params.client.crypto.listVerifications().catch(() => [])).some((entry) => entry.isSelfVerification && !entry.completed && entry.pending)) return {
|
|
64
|
+
kind: "pending",
|
|
65
|
+
verification
|
|
66
|
+
};
|
|
67
|
+
const cooldownMs = normalizeCooldownHours(params.accountConfig.startupVerificationCooldownHours) * 60 * 60 * 1e3;
|
|
68
|
+
const nowMs = params.nowMs ?? Date.now();
|
|
69
|
+
const attemptedAt = resolveStartupVerificationTimestamp(nowMs);
|
|
70
|
+
const value = await createStartupVerificationStore(stateLocation).lookup(stateKey);
|
|
71
|
+
const state = value && typeof value === "object" ? value : null;
|
|
72
|
+
const retryAfterMs = resolveStartupVerificationRetryAfterMs({
|
|
73
|
+
state,
|
|
74
|
+
verification,
|
|
75
|
+
stateCooldownMs: state?.outcome === "failed" ? Math.min(cooldownMs, DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS) : cooldownMs,
|
|
76
|
+
nowMs
|
|
77
|
+
});
|
|
78
|
+
if (retryAfterMs !== void 0) return {
|
|
79
|
+
kind: "cooldown",
|
|
80
|
+
verification,
|
|
81
|
+
retryAfterMs
|
|
82
|
+
};
|
|
83
|
+
const writeState = async (outcome) => {
|
|
84
|
+
await createStartupVerificationStore(stateLocation).register(stateKey, {
|
|
85
|
+
userId: verification.userId,
|
|
86
|
+
deviceId: verification.deviceId,
|
|
87
|
+
attemptedAt,
|
|
88
|
+
...outcome
|
|
89
|
+
});
|
|
90
|
+
if (typeof verification.deviceId === "string" && verification.deviceId.trim()) await recordCurrentStorageMetaDeviceId({
|
|
91
|
+
rootDir: path.dirname(statePath),
|
|
92
|
+
deviceId: verification.deviceId
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
try {
|
|
96
|
+
const request = await params.client.crypto.requestVerification({ ownUser: true });
|
|
97
|
+
await writeState({
|
|
98
|
+
outcome: "requested",
|
|
99
|
+
requestId: request.id,
|
|
100
|
+
transactionId: request.transactionId
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
kind: "requested",
|
|
104
|
+
verification,
|
|
105
|
+
requestId: request.id,
|
|
106
|
+
transactionId: request.transactionId ?? void 0
|
|
107
|
+
};
|
|
108
|
+
} catch (err) {
|
|
109
|
+
const error = formatErrorMessage(err);
|
|
110
|
+
await writeState({
|
|
111
|
+
outcome: "failed",
|
|
112
|
+
error
|
|
113
|
+
}).catch(() => {});
|
|
114
|
+
return {
|
|
115
|
+
kind: "request-failed",
|
|
116
|
+
verification,
|
|
117
|
+
error
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { ensureMatrixStartupVerification };
|