Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat!: move sync service to this repo (#924)

teo0e1e4cece25a
diff --git a/rust/sync-service/.gitignore b/rust/sync-service/.gitignore
new file mode 100644
index 0000000000..af48321f54
--- /dev/null
+++ b/rust/sync-service/.gitignore
@@ -0,0 +1,5 @@
+target
+node_modules
+.wrangler
+data
+dist
diff --git a/rust/sync-service/Cargo.lock b/rust/sync-service/Cargo.lock
new file mode 100644
index 0000000000..f6217c28e7
--- /dev/null
+++ b/rust/sync-service/Cargo.lock
@@ -0,0 +1,3383 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "addr2line"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler2"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+
+[[package]]
+name = "aes"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
+dependencies = [
+ "cfg-if",
+ "cipher",
+ "cpufeatures",
+]
+
+[[package]]
+name = "ahash"
+version = "0.8.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
+dependencies = [
+ "cfg-if",
+ "getrandom 0.3.3",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "append-only-bytes"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac436601d6bdde674a0d7fb593e829ffe7b3387c351b356dd20e2d40f5bf3ee5"
+
+[[package]]
+name = "arbitrary"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
+dependencies = [
+ "derive_arbitrary",
+]
+
+[[package]]
+name = "arrayvec"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
+
+[[package]]
+name = "arref"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ccd462b64c3c72f1be8305905a85d85403d768e8690c9b8bd3b9009a5761679"
+
+[[package]]
+name = "async-trait"
+version = "0.1.89"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "atomic-polyfill"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
+dependencies = [
+ "critical-section",
+]
+
+[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+
+[[package]]
+name = "autocfg"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
+
+[[package]]
+name = "backtrace"
+version = "0.3.75"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "base64"
+version = "0.22.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
+
+[[package]]
+name = "bebop"
+version = "3.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a449fabb1ce3678c72506e2fb37f790226ce5daa750cc96e274f76311b4c67d5"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "bebop-tools"
+version = "3.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd4a21710e033cb7adec0f9c158f3fd273762f1641afc1e3c3a1420e8c3e1f8f"
+dependencies = [
+ "json",
+ "reqwest",
+ "which",
+ "zip",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d"
+
+[[package]]
+name = "bitmaps"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
+dependencies = [
+ "typenum",
+]
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "bytes"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
+
+[[package]]
+name = "bzip2"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47"
+dependencies = [
+ "bzip2-sys",
+]
+
+[[package]]
+name = "bzip2-sys"
+version = "0.1.13+1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14"
+dependencies = [
+ "cc",
+ "pkg-config",
+]
+
+[[package]]
+name = "cc"
+version = "1.2.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc"
+dependencies = [
+ "jobserver",
+ "libc",
+ "shlex",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
+
+[[package]]
+name = "chrono"
+version = "0.4.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
+dependencies = [
+ "js-sys",
+ "num-traits",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "cipher"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
+dependencies = [
+ "crypto-common",
+ "inout",
+]
+
+[[package]]
+name = "cobs"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
+dependencies = [
+ "thiserror 2.0.16",
+]
+
+[[package]]
+name = "constant_time_eq"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6"
+
+[[package]]
+name = "core-foundation"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crc"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675"
+dependencies = [
+ "crc-catalog",
+]
+
+[[package]]
+name = "crc-catalog"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
+
+[[package]]
+name = "crc32fast"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "critical-section"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "darling"
+version = "0.20.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
+dependencies = [
+ "darling_core",
+ "darling_macro",
+]
+
+[[package]]
+name = "darling_core"
+version = "0.20.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
+dependencies = [
+ "fnv",
+ "ident_case",
+ "proc-macro2",
+ "quote",
+ "strsim",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "darling_macro"
+version = "0.20.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
+dependencies = [
+ "darling_core",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "deflate64"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b"
+
+[[package]]
+name = "deranged"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
+dependencies = [
+ "powerfmt",
+]
+
+[[package]]
+name = "derive_arbitrary"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "diff"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+ "subtle",
+]
+
+[[package]]
+name = "displaydoc"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "either"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
+
+[[package]]
+name = "embedded-io"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced"
+
+[[package]]
+name = "embedded-io"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "ensure-cov"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33753185802e107b8fa907192af1f0eca13b1fb33327a59266d650fef29b2b4e"
+
+[[package]]
+name = "enum-as-inner"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
+dependencies = [
+ "heck 0.4.1",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "enum-as-inner"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc"
+dependencies = [
+ "heck 0.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "enum_dispatch"
+version = "0.3.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd"
+dependencies = [
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
+
+[[package]]
+name = "errno"
+version = "0.3.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
+dependencies = [
+ "libc",
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
+
+[[package]]
+name = "flate2"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
+[[package]]
+name = "form_urlencoded"
+version = "1.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
+dependencies = [
+ "percent-encoding",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
+
+[[package]]
+name = "futures-io"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
+
+[[package]]
+name = "futures-task"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
+
+[[package]]
+name = "futures-util"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
+dependencies = [
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "fxhash"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
+dependencies = [
+ "byteorder",
+]
+
+[[package]]
+name = "generator"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
+dependencies = [
+ "cc",
+ "cfg-if",
+ "libc",
+ "log",
+ "rustversion",
+ "windows",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "generic-btree"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b13a097f720b8275947f5bf0f499a5a08f13341fc4c74bb87fb111b95db6e63"
+dependencies = [
+ "arref",
+ "fxhash",
+ "heapless 0.9.1",
+ "itertools 0.11.0",
+ "loro-thunderdome",
+ "proc-macro2",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "wasi 0.11.1+wasi-snapshot-preview1",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "r-efi",
+ "wasi 0.14.3+wasi-0.2.4",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "gimli"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
+
+[[package]]
+name = "h2"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386"
+dependencies = [
+ "atomic-waker",
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "http",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hash32"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
+dependencies = [
+ "byteorder",
+]
+
+[[package]]
+name = "hash32"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
+dependencies = [
+ "byteorder",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.15.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
+
+[[package]]
+name = "heapless"
+version = "0.7.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f"
+dependencies = [
+ "atomic-polyfill",
+ "hash32 0.2.1",
+ "rustc_version",
+ "serde",
+ "spin",
+ "stable_deref_trait",
+]
+
+[[package]]
+name = "heapless"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
+dependencies = [
+ "hash32 0.3.1",
+ "stable_deref_trait",
+]
+
+[[package]]
+name = "heapless"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
+dependencies = [
+ "hash32 0.3.1",
+ "stable_deref_trait",
+]
+
+[[package]]
+name = "heck"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
+
+[[package]]
+name = "heck"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
+
+[[package]]
+name = "hmac"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
+dependencies = [
+ "digest",
+]
+
+[[package]]
+name = "home"
+version = "0.5.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "http"
+version = "1.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http-body"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
+dependencies = [
+ "bytes",
+ "http",
+]
+
+[[package]]
+name = "http-body-util"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "http",
+ "http-body",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "httparse"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
+
+[[package]]
+name = "hyper"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e"
+dependencies = [
+ "atomic-waker",
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "h2",
+ "http",
+ "http-body",
+ "httparse",
+ "itoa",
+ "pin-project-lite",
+ "pin-utils",
+ "smallvec",
+ "tokio",
+ "want",
+]
+
+[[package]]
+name = "hyper-rustls"
+version = "0.27.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
+dependencies = [
+ "http",
+ "hyper",
+ "hyper-util",
+ "rustls",
+ "rustls-pki-types",
+ "tokio",
+ "tokio-rustls",
+ "tower-service",
+]
+
+[[package]]
+name = "hyper-tls"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
+dependencies = [
+ "bytes",
+ "http-body-util",
+ "hyper",
+ "hyper-util",
+ "native-tls",
+ "tokio",
+ "tokio-native-tls",
+ "tower-service",
+]
+
+[[package]]
+name = "hyper-util"
+version = "0.1.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
+dependencies = [
+ "base64",
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "http",
+ "http-body",
+ "hyper",
+ "ipnet",
+ "libc",
+ "percent-encoding",
+ "pin-project-lite",
+ "socket2",
+ "system-configuration",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "windows-registry",
+]
+
+[[package]]
+name = "icu_collections"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47"
+dependencies = [
+ "displaydoc",
+ "potential_utf",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locale_core"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer_data"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3"
+
+[[package]]
+name = "icu_properties"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_locale_core",
+ "icu_properties_data",
+ "icu_provider",
+ "potential_utf",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_properties_data"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632"
+
+[[package]]
+name = "icu_provider"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af"
+dependencies = [
+ "displaydoc",
+ "icu_locale_core",
+ "stable_deref_trait",
+ "tinystr",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "ident_case"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
+
+[[package]]
+name = "idna"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
+dependencies = [
+ "idna_adapter",
+ "smallvec",
+ "utf8_iter",
+]
+
+[[package]]
+name = "idna_adapter"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+]
+
+[[package]]
+name = "im"
+version = "15.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9"
+dependencies = [
+ "bitmaps",
+ "rand_core",
+ "rand_xoshiro",
+ "serde",
+ "sized-chunks",
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "inout"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "io-uring"
+version = "0.7.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b"
+dependencies = [
+ "bitflags 2.9.3",
+ "cfg-if",
+ "libc",
+]
+
+[[package]]
+name = "ipnet"
+version = "2.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
+
+[[package]]
+name = "iri-string"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
+dependencies = [
+ "memchr",
+ "serde",
+]
+
+[[package]]
+name = "itertools"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itertools"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
+
+[[package]]
+name = "jobserver"
+version = "0.1.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
+dependencies = [
+ "getrandom 0.3.3",
+ "libc",
+]
+
+[[package]]
+name = "js-sys"
+version = "0.3.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65"
+dependencies = [
+ "once_cell",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "json"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd"
+
+[[package]]
+name = "jsonwebtoken"
+version = "9.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde"
+dependencies = [
+ "base64",
+ "js-sys",
+ "pem",
+ "ring",
+ "serde",
+ "serde_json",
+ "simple_asn1",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
+
+[[package]]
+name = "leb128"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
+
+[[package]]
+name = "libc"
+version = "0.2.175"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
+
+[[package]]
+name = "litemap"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
+
+[[package]]
+name = "lock_api"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
+
+[[package]]
+name = "loom"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
+dependencies = [
+ "cfg-if",
+ "generator",
+ "scoped-tls",
+ "serde",
+ "serde_json",
+ "tracing",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "loro"
+version = "1.5.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a95643130841a4deab62ad4b7d782d0bac71688480f4efade6d13d9c5ca741d2"
+dependencies = [
+ "enum-as-inner 0.6.1",
+ "fxhash",
+ "generic-btree",
+ "loro-common",
+ "loro-delta",
+ "loro-internal",
+ "loro-kv-store",
+ "tracing",
+]
+
+[[package]]
+name = "loro-common"
+version = "1.5.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1b0b2739af1bc260f0a7d7cf072bf7d28c584ff021c0bc28b2a911b4822543b"
+dependencies = [
+ "arbitrary",
+ "enum-as-inner 0.6.1",
+ "fxhash",
+ "leb128",
+ "loro-rle",
+ "nonmax",
+ "serde",
+ "serde_columnar",
+ "serde_json",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "loro-delta"
+version = "1.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e9b920ad564430b2e392ac6f0e8f97ef5745960cc40edc482be57a407db1c243"
+dependencies = [
+ "arrayvec",
+ "enum-as-inner 0.5.1",
+ "generic-btree",
+ "heapless 0.8.0",
+]
+
+[[package]]
+name = "loro-internal"
+version = "1.5.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30e016320208e96cc20ed01a050a2fea10fc71760fde7a7670a673d6af4b7905"
+dependencies = [
+ "append-only-bytes",
+ "arref",
+ "bytes",
+ "either",
+ "ensure-cov",
+ "enum-as-inner 0.6.1",
+ "enum_dispatch",
+ "fxhash",
+ "generic-btree",
+ "getrandom 0.2.16",
+ "im",
+ "itertools 0.12.1",
+ "leb128",
+ "loom",
+ "loro-common",
+ "loro-delta",
+ "loro-kv-store",
+ "loro-rle",
+ "loro_fractional_index",
+ "md5",
+ "nonmax",
+ "num",
+ "num-traits",
+ "once_cell",
+ "postcard",
+ "pretty_assertions",
+ "rand",
+ "serde",
+ "serde_columnar",
+ "serde_json",
+ "smallvec",
+ "thiserror 1.0.69",
+ "thread_local",
+ "tracing",
+ "wasm-bindgen",
+ "xxhash-rust",
+]
+
+[[package]]
+name = "loro-kv-store"
+version = "1.5.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f54a5e9e9c3cb13e162835c1e94cf6b9df691b6e1bbc456f4cdc0471968adc82"
+dependencies = [
+ "bytes",
+ "ensure-cov",
+ "fxhash",
+ "loro-common",
+ "lz4_flex",
+ "once_cell",
+ "quick_cache",
+ "tracing",
+ "xxhash-rust",
+]
+
+[[package]]
+name = "loro-rle"
+version = "1.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "077b51e4eac04e7f18574f7e6ac0201ffd98ff65015343eee3702bc3e7c49dc8"
+dependencies = [
+ "append-only-bytes",
+ "num",
+ "smallvec",
+]
+
+[[package]]
+name = "loro-thunderdome"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f3d053a135388e6b1df14e8af1212af5064746e9b87a06a345a7a779ee9695a"
+
+[[package]]
+name = "loro_fractional_index"
+version = "1.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e387a04d7d6a74ebb3434c906c84ddcae4413e5ef8bcd8e7d5138959d416a512"
+dependencies = [
+ "once_cell",
+ "rand",
+ "serde",
+]
+
+[[package]]
+name = "lz4_flex"
+version = "0.11.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a"
+dependencies = [
+ "twox-hash",
+]
+
+[[package]]
+name = "lzma-rs"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e"
+dependencies = [
+ "byteorder",
+ "crc",
+]
+
+[[package]]
+name = "lzma-sys"
+version = "0.1.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+]
+
+[[package]]
+name = "matchers"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
+dependencies = [
+ "regex-automata",
+]
+
+[[package]]
+name = "matchit"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
+
+[[package]]
+name = "matchit"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f926ade0c4e170215ae43342bf13b9310a437609c81f29f86c5df6657582ef9"
+
+[[package]]
+name = "md5"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
+
+[[package]]
+name = "memchr"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
+
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+dependencies = [
+ "adler2",
+]
+
+[[package]]
+name = "mio"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
+dependencies = [
+ "libc",
+ "wasi 0.11.1+wasi-snapshot-preview1",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "native-tls"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
+dependencies = [
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
+[[package]]
+name = "nonmax"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51"
+
+[[package]]
+name = "nu-ansi-term"
+version = "0.50.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
+dependencies = [
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "num"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
+dependencies = [
+ "num-bigint",
+ "num-complex",
+ "num-integer",
+ "num-iter",
+ "num-rational",
+ "num-traits",
+]
+
+[[package]]
+name = "num-bigint"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-complex"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "num-conv"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
+
+[[package]]
+name = "num-integer"
+version = "0.1.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "num-iter"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
+dependencies = [
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "object"
+version = "0.36.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.21.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
+
+[[package]]
+name = "openssl"
+version = "0.10.73"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
+dependencies = [
+ "bitflags 2.9.3",
+ "cfg-if",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "openssl-probe"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "pbkdf2"
+version = "0.12.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
+dependencies = [
+ "digest",
+ "hmac",
+]
+
+[[package]]
+name = "pem"
+version = "3.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3"
+dependencies = [
+ "base64",
+ "serde",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
+
+[[package]]
+name = "pin-project"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
+dependencies = [
+ "pin-project-internal",
+]
+
+[[package]]
+name = "pin-project-internal"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
+
+[[package]]
+name = "postcard"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
+dependencies = [
+ "cobs",
+ "embedded-io 0.4.0",
+ "embedded-io 0.6.1",
+ "heapless 0.7.17",
+ "serde",
+]
+
+[[package]]
+name = "potential_utf"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a"
+dependencies = [
+ "zerovec",
+]
+
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "pretty_assertions"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
+dependencies = [
+ "diff",
+ "yansi",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.101"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quick_cache"
+version = "0.6.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ad6644cb07b7f3488b9f3d2fde3b4c0a7fa367cafefb39dff93a659f76eb786"
+dependencies = [
+ "ahash",
+ "equivalent",
+ "hashbrown",
+ "parking_lot",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "r-efi"
+version = "5.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom 0.2.16",
+]
+
+[[package]]
+name = "rand_xoshiro"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77"
+dependencies = [
+ "bitflags 2.9.3",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
+
+[[package]]
+name = "reqwest"
+version = "0.12.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
+dependencies = [
+ "base64",
+ "bytes",
+ "encoding_rs",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "http-body-util",
+ "hyper",
+ "hyper-rustls",
+ "hyper-tls",
+ "hyper-util",
+ "js-sys",
+ "log",
+ "mime",
+ "native-tls",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustls-pki-types",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper",
+ "tokio",
+ "tokio-native-tls",
+ "tower",
+ "tower-http",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
+[[package]]
+name = "ring"
+version = "0.17.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
+dependencies = [
+ "cc",
+ "cfg-if",
+ "getrandom 0.2.16",
+ "libc",
+ "untrusted",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
+
+[[package]]
+name = "rustc_version"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rustix"
+version = "0.38.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
+dependencies = [
+ "bitflags 2.9.3",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.4.15",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "rustix"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
+dependencies = [
+ "bitflags 2.9.3",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.9.4",
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "rustls"
+version = "0.23.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc"
+dependencies = [
+ "once_cell",
+ "rustls-pki-types",
+ "rustls-webpki",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "rustls-pki-types"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79"
+dependencies = [
+ "zeroize",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.103.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
+dependencies = [
+ "ring",
+ "rustls-pki-types",
+ "untrusted",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
+
+[[package]]
+name = "ryu"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
+
+[[package]]
+name = "schannel"
+version = "0.1.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "scoped-tls"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "security-framework"
+version = "2.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+dependencies = [
+ "bitflags 2.9.3",
+ "core-foundation",
+ "core-foundation-sys",
+ "libc",
+ "security-framework-sys",
+]
+
+[[package]]
+name = "security-framework-sys"
+version = "2.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "semver"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
+
+[[package]]
+name = "serde"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde-wasm-bindgen"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b"
+dependencies = [
+ "js-sys",
+ "serde",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "serde_columnar"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5910a00acc21b3f106b9e3977cabf8d4c15b62ea585664f08ec6fedb118d88e0"
+dependencies = [
+ "itertools 0.11.0",
+ "postcard",
+ "serde",
+ "serde_columnar_derive",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "serde_columnar_derive"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44cea1995b758f1b344f484e77a02d9d85c8a62c9ce0e5f1850e27e2f7eebbc9"
+dependencies = [
+ "darling",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.143"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
+dependencies = [
+ "itoa",
+ "memchr",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "sha1"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
+name = "sharded-slab"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
+[[package]]
+name = "simd-adler32"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
+
+[[package]]
+name = "simple_asn1"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb"
+dependencies = [
+ "num-bigint",
+ "num-traits",
+ "thiserror 2.0.16",
+ "time",
+]
+
+[[package]]
+name = "sized-chunks"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e"
+dependencies = [
+ "bitmaps",
+ "typenum",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
+
+[[package]]
+name = "smallvec"
+version = "1.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "socket2"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
+dependencies = [
+ "libc",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "spin"
+version = "0.9.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+dependencies = [
+ "lock_api",
+]
+
+[[package]]
+name = "stable_deref_trait"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
+
+[[package]]
+name = "strsim"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
+
+[[package]]
+name = "subtle"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.106"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "sync_service"
+version = "0.1.0"
+dependencies = [
+ "bebop",
+ "bebop-tools",
+ "jsonwebtoken",
+ "loro",
+ "matchit 0.8.6",
+ "serde",
+ "serde_json",
+ "time",
+ "tracing",
+ "tracing-subscriber",
+ "tracing-web",
+ "uuid",
+ "wasm-bindgen",
+ "web-time",
+ "worker",
+]
+
+[[package]]
+name = "sync_wrapper"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
+dependencies = [
+ "futures-core",
+]
+
+[[package]]
+name = "synstructure"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "system-configuration"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
+dependencies = [
+ "bitflags 2.9.3",
+ "core-foundation",
+ "system-configuration-sys",
+]
+
+[[package]]
+name = "system-configuration-sys"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.21.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e"
+dependencies = [
+ "fastrand",
+ "getrandom 0.3.3",
+ "once_cell",
+ "rustix 1.0.8",
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl 1.0.69",
+]
+
+[[package]]
+name = "thiserror"
+version = "2.0.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
+dependencies = [
+ "thiserror-impl 2.0.16",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "time"
+version = "0.3.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
+dependencies = [
+ "deranged",
+ "itoa",
+ "js-sys",
+ "num-conv",
+ "powerfmt",
+ "serde",
+ "time-core",
+ "time-macros",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
+
+[[package]]
+name = "time-macros"
+version = "0.2.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
+dependencies = [
+ "num-conv",
+ "time-core",
+]
+
+[[package]]
+name = "tinystr"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b"
+dependencies = [
+ "displaydoc",
+ "zerovec",
+]
+
+[[package]]
+name = "tokio"
+version = "1.47.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
+dependencies = [
+ "backtrace",
+ "bytes",
+ "io-uring",
+ "libc",
+ "mio",
+ "pin-project-lite",
+ "slab",
+ "socket2",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "tokio-native-tls"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
+dependencies = [
+ "native-tls",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-rustls"
+version = "0.26.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b"
+dependencies = [
+ "rustls",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "tower"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
+dependencies = [
+ "futures-core",
+ "futures-util",
+ "pin-project-lite",
+ "sync_wrapper",
+ "tokio",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
+dependencies = [
+ "bitflags 2.9.3",
+ "bytes",
+ "futures-util",
+ "http",
+ "http-body",
+ "iri-string",
+ "pin-project-lite",
+ "tower",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "tower-layer"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
+
+[[package]]
+name = "tower-service"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
+
+[[package]]
+name = "tracing"
+version = "0.1.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+dependencies = [
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
+dependencies = [
+ "once_cell",
+ "valuable",
+]
+
+[[package]]
+name = "tracing-log"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
+dependencies = [
+ "log",
+ "once_cell",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-serde"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
+dependencies = [
+ "serde",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-subscriber"
+version = "0.3.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
+dependencies = [
+ "matchers",
+ "nu-ansi-term",
+ "once_cell",
+ "regex-automata",
+ "serde",
+ "serde_json",
+ "sharded-slab",
+ "smallvec",
+ "thread_local",
+ "time",
+ "tracing",
+ "tracing-core",
+ "tracing-log",
+ "tracing-serde",
+]
+
+[[package]]
+name = "tracing-web"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9e6a141feebd51f8d91ebfd785af50fca223c570b86852166caa3b141defe7c"
+dependencies = [
+ "js-sys",
+ "tracing-core",
+ "tracing-subscriber",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+
+[[package]]
+name = "twox-hash"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b907da542cbced5261bd3256de1b3a1bf340a3d37f93425a07362a1d687de56"
+
+[[package]]
+name = "typenum"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+
+[[package]]
+name = "untrusted"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
+
+[[package]]
+name = "url"
+version = "2.5.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "percent-encoding",
+ "serde",
+]
+
+[[package]]
+name = "utf8_iter"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+
+[[package]]
+name = "uuid"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be"
+dependencies = [
+ "getrandom 0.3.3",
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "valuable"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
+
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "want"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+dependencies = [
+ "try-lock",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.1+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+
+[[package]]
+name = "wasi"
+version = "0.14.3+wasi-0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95"
+dependencies = [
+ "wit-bindgen",
+]
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.105"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "rustversion",
+ "wasm-bindgen-macro",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "once_cell",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.105"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.105"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc"
+dependencies = [
+ "bumpalo",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.105"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "wasm-streams"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65"
+dependencies = [
+ "futures-util",
+ "js-sys",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
+[[package]]
+name = "web-sys"
+version = "0.3.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "web-time"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "which"
+version = "6.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f"
+dependencies = [
+ "either",
+ "home",
+ "rustix 0.38.44",
+ "winsafe",
+]
+
+[[package]]
+name = "windows"
+version = "0.61.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
+dependencies = [
+ "windows-collections",
+ "windows-core",
+ "windows-future",
+ "windows-link",
+ "windows-numerics",
+]
+
+[[package]]
+name = "windows-collections"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
+dependencies = [
+ "windows-core",
+]
+
+[[package]]
+name = "windows-core"
+version = "0.61.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
+dependencies = [
+ "windows-implement",
+ "windows-interface",
+ "windows-link",
+ "windows-result",
+ "windows-strings",
+]
+
+[[package]]
+name = "windows-future"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
+dependencies = [
+ "windows-core",
+ "windows-link",
+ "windows-threading",
+]
+
+[[package]]
+name = "windows-implement"
+version = "0.60.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "windows-interface"
+version = "0.59.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "windows-link"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
+
+[[package]]
+name = "windows-numerics"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
+dependencies = [
+ "windows-core",
+ "windows-link",
+]
+
+[[package]]
+name = "windows-registry"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
+dependencies = [
+ "windows-link",
+ "windows-result",
+ "windows-strings",
+]
+
+[[package]]
+name = "windows-result"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-strings"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.60.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
+dependencies = [
+ "windows-targets 0.53.3",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm 0.52.6",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.53.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
+dependencies = [
+ "windows-link",
+ "windows_aarch64_gnullvm 0.53.0",
+ "windows_aarch64_msvc 0.53.0",
+ "windows_i686_gnu 0.53.0",
+ "windows_i686_gnullvm 0.53.0",
+ "windows_i686_msvc 0.53.0",
+ "windows_x86_64_gnu 0.53.0",
+ "windows_x86_64_gnullvm 0.53.0",
+ "windows_x86_64_msvc 0.53.0",
+]
+
+[[package]]
+name = "windows-threading"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.53.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
+
+[[package]]
+name = "winsafe"
+version = "0.0.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904"
+
+[[package]]
+name = "wit-bindgen"
+version = "0.45.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814"
+
+[[package]]
+name = "worker"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9320293035d2074f1fb84baf7d79d7932c183dd04a7e0c143dc75db0d0037ac"
+dependencies = [
+ "async-trait",
+ "bytes",
+ "chrono",
+ "futures-channel",
+ "futures-util",
+ "http",
+ "http-body",
+ "js-sys",
+ "matchit 0.7.3",
+ "pin-project",
+ "serde",
+ "serde-wasm-bindgen",
+ "serde_json",
+ "serde_urlencoded",
+ "tokio",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wasm-streams",
+ "web-sys",
+ "worker-macros",
+ "worker-sys",
+]
+
+[[package]]
+name = "worker-macros"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb37d4f9d99921836a1e4dc21e6041df9b0c2c5fe3c230edddd172a8ef9e251e"
+dependencies = [
+ "async-trait",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wasm-bindgen-macro-support",
+ "worker-sys",
+]
+
+[[package]]
+name = "worker-sys"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07b4e2ca5d405247a986d533bba78c396c941835747977631168b8b05304f1b6"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "writeable"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
+
+[[package]]
+name = "xxhash-rust"
+version = "0.8.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3"
+
+[[package]]
+name = "xz2"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2"
+dependencies = [
+ "lzma-sys",
+]
+
+[[package]]
+name = "yansi"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
+
+[[package]]
+name = "yoke"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc"
+dependencies = [
+ "serde",
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+ "synstructure",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.8.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.8.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+ "synstructure",
+]
+
+[[package]]
+name = "zeroize"
+version = "1.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
+dependencies = [
+ "zeroize_derive",
+]
+
+[[package]]
+name = "zeroize_derive"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "zerotrie"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595"
+dependencies = [
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+]
+
+[[package]]
+name = "zerovec"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.106",
+]
+
+[[package]]
+name = "zip"
+version = "2.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50"
+dependencies = [
+ "aes",
+ "arbitrary",
+ "bzip2",
+ "constant_time_eq",
+ "crc32fast",
+ "crossbeam-utils",
+ "deflate64",
+ "displaydoc",
+ "flate2",
+ "getrandom 0.3.3",
+ "hmac",
+ "indexmap",
+ "lzma-rs",
+ "memchr",
+ "pbkdf2",
+ "sha1",
+ "thiserror 2.0.16",
+ "time",
+ "xz2",
+ "zeroize",
+ "zopfli",
+ "zstd",
+]
+
+[[package]]
+name = "zopfli"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edfc5ee405f504cd4984ecc6f14d02d55cfda60fa4b689434ef4102aae150cd7"
+dependencies = [
+ "bumpalo",
+ "crc32fast",
+ "log",
+ "simd-adler32",
+]
+
+[[package]]
+name = "zstd"
+version = "0.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a"
+dependencies = [
+ "zstd-safe",
+]
+
+[[package]]
+name = "zstd-safe"
+version = "7.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d"
+dependencies = [
+ "zstd-sys",
+]
+
+[[package]]
+name = "zstd-sys"
+version = "2.0.15+zstd.1.5.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237"
+dependencies = [
+ "cc",
+ "pkg-config",
+]
diff --git a/rust/sync-service/Cargo.toml b/rust/sync-service/Cargo.toml
new file mode 100644
index 0000000000..d53d6e753b
--- /dev/null
+++ b/rust/sync-service/Cargo.toml
@@ -0,0 +1,58 @@
+[package]
+name = "sync_service"
+version = "0.1.0"
+edition = "2024"
+authors = ["synoet <[email protected]>"]
+build = "build.rs"
+
+[features]
+default = ["bebop-owned-all", "do-sqlite-snapshot-storage", "search-service"]
+no-network-deps = []
+do-sqlite-snapshot-storage = []
+kv-snapshot-storage = []
+r2-snapshot-storage = []
+search-service = []
+bebop-owned-all = []
+create-default-state = []
+alarm-keep-alive = []
+
+[lib]
+crate-type = ["cdylib"]
+
+[package.metadata.release]
+release = false
+
+[profile.release]
+# enable link time optimization
+lto = true
+# optimize for size
+opt-level = 's'
+# even smaller but remove's vectorization, and is slower
+#opt-level = 'z'
+
+[package.metadata.wasm-pack.profile.release]
+# https://github.com/rustwasm/wasm-pack/issues/1247
+wasm-opt = true
+
+[dependencies]
+worker = { version = "=0.6.7", features = ['d1'] }
+tracing = { version = "0.1" }
+tracing-subscriber = { version = "0.3", features = [
+ 'time',
+ 'json',
+ 'env-filter',
+] }
+tracing-web = "0.1"
+web-time = "1.1.0"
+time = { version = "0.3", features = ['wasm-bindgen'] }
+bebop = "3.1.3"
+serde_json = "1.0.140"
+serde = { version = "1.0.219", features = ["derive"] }
+wasm-bindgen = "0.2.100"
+uuid = { version = "1.16.0", features = ["v4", "js"] }
+loro = "1.5.6"
+jsonwebtoken = "9.3.1"
+matchit = "0.8.4"
+
+[build-dependencies]
+bebop-tools = "3.1.3"
diff --git a/rust/sync-service/README.md b/rust/sync-service/README.md
new file mode 100644
index 0000000000..894b3173c2
--- /dev/null
+++ b/rust/sync-service/README.md
@@ -0,0 +1,117 @@
+# Sync Service
+Service responsible for syncing collaborative documents between multiple users.
+
+## Project Structure
+```bash
+.
+├── bebop/ # bebop schema and ts generator for tests & qa
+├── build.rs # build script for worker, to generate bebop rust bindings
+├── justfile # justfile for running commands
+├── qa-env/ # solid-js qa environment
+├── src/ # rust worker-rs worker
+├── tests/ # e2e tests using miniflare and vitest
+└── wrangler.toml # wrangler configuration
+```
+
+## Architecture
+The sync service leverages Cloudflare's Durable Objects to create session servers or "rooms" for each document. A Durable Object functions as a worker with both in-memory state and persistent storage capabilities.
+
+Using Cloudflare's Durable Objects API, we can dynamically create and request these objects on demand for individual documents. To connect and receive updates from a document, a client establishes a WebSocket connection to /document/:document_id.
+
+When a connection is established, the worker checks if a Durable Object already exists for the document and creates a new one if necessary. Each Durable Object maintains two types of state:
+
+- In-memory state: Contains the loro_document itself, along with metadata about the document's current state
+- Persistable state: Stores data that survives even when the in-memory state is cleared
+
+The in-memory state and loro_document are initialized using a loro-snapshot retrieved from the Durable Object's persistent storage. By default, Durable Objects evict in-memory state after 10 seconds of inactivity. This can occur even when connections to the Durable Object exist, as long as there are no WebSocket messages or alarm invocations within that timeframe.
+
+Since generating and importing loro snapshots is computationally expensive, we want to maintain the in-memory state as long as active connections exist. To accomplish this, we implement a "heartbeat" system by scheduling an alarm for 5 seconds into the future, similar to a debounce mechanism. Even without incoming WebSocket messages, this alarm fires regularly, preventing the in-memory state from being evicted.
+When a client updates a document via a WebSocket message, we apply the update to the in-memory loro document. Whenever the alarm fires, we generate a new loro snapshot and store it in the Durable Object's persistent storage. When a new user connects to the document, we retrieve both the latest snapshot and any pending operations from persistent storage, then send a complete snapshot to the client.
+
+### Authentication
+
+`document_storage_service` will generate a jwt with permissions for the document. This jwt will be passed to the connecting websocket using queryParams.
+Unfortunately, query params are the best way to authenticate a websocket connection. Since we use tls, query params should be encrypted in transit.
+the `sync-service` will verify the jwt and ensure that the user has the correct permissions to access the document.
+
+TODO: eventually we will want to validate based on the `access_level` field in the token that the user only receives updates and does not push any updates to the document.
+
+
+## Bebop
+The bebop schema is defined in `./bebop/schema.bop`.
+
+#### Generating typescript bindings locally
+The typescript bindings are primarily used for testing and QA environemnt.
+```bash
+cd bebop && npx bebop-tools build
+```
+
+#### Generating rust bindings locally
+Rust bindings get automatically generated when building the worker.
+The behavior for this is defined in `./build.rs`.
+```bash
+worker-build --release
+```
+
+#### Generating bindings elsewhere
+The sync_service exposes an endpoint `/schema` which returns the bebop schema.
+A consuming client can fetch this schema during build time and generate the corresponding typescript / rust bindings.
+
+## Features
+
+By default `bebop-owned-all`, `alarm-keep-alive` and `create-default-state` are all enabled.
+
+- `bebop-owned-all`: Enables all bebop owned types
+- `create-default-state`: As of writing this there is no mechanism to initialize a document's state
+from existing state on the client. If a client fetches a document for the first time the worker will create
+some default state for it. In the future, this feature should be disabled, and we should be inheriting default state
+from the client.
+- `alarm-keep-alive`: This feature is used to prevent the in-memory state from being evicted when there are still
+active connections to the document. :warning: Tests should be run with both this feature enabled and disabled, to ensure
+that in a case where eviction logic is not working as expected, the core logic is still correct even though it might be slower.
+
+## Development
+
+We have 3 environments "test", "dev", and "prod". When developing we typically use "testing". This is deployed with `npx wrangler deploy`, dev with `npx wrangler deploy --env dev`, and prod with `npx wrangler deploy --env prod`.
+
+#### Testing
+
+#### Running Locally
+Run:
+
+```bash
+npx wrangler dev
+# or
+just dev
+```
+
+If you run into build errors related to clang, follow [this fix](https://github.com/briansmith/ring/issues/1824#issuecomment-2059955073):
+
+Ensure you have llvm installed and available on your `PATH`. For mac with zsh this looks like:
+```
+# install llvm
+brew install llvm
+# add it to your PATH for zsh
+echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
+```
+
+#### Running tests locally
+```bash
+# runs only unit tests
+cargo test
+
+# runs both unit tests and e2e tests
+just test
+
+# runs e2e tests with the alarm-keep-alive feature disabled
+just test-no-alarm
+```
+
+#### Running QA environment locally
+The qa environment spins up the worker locally using miniflare. It also spawns a bunnch of instances each with their own websocket connection to the worker.
+```bash
+just debug
+```
+
+when making a new deploy you need to make a cloudflare KV store
+and D1 database
diff --git a/rust/sync-service/bebop/bebop.json b/rust/sync-service/bebop/bebop.json
new file mode 100644
index 0000000000..c6561ecc1c
--- /dev/null
+++ b/rust/sync-service/bebop/bebop.json
@@ -0,0 +1,10 @@
+{
+ "include": [
+ "./schema.bop"
+ ],
+ "generators": {
+ "ts": {
+ "outFile": "./generated/schema.ts"
+ }
+ }
+}
diff --git a/rust/sync-service/bebop/generated/schema.ts b/rust/sync-service/bebop/generated/schema.ts
new file mode 100644
index 0000000000..d39549c53c
--- /dev/null
+++ b/rust/sync-service/bebop/generated/schema.ts
@@ -0,0 +1,1903 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+//
+// bebopc version:
+// 3.1.3
+//
+//
+// bebopc source:
+// https://github.com/betwixt-labs/bebop
+//
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+import { BebopView, BebopRuntimeError, BebopRecord, BebopJson, BebopTypeGuard, Guid, GuidMap } from "bebop";
+
+export const BEBOP_SCHEMA = new Uint8Array ([
+3, 16, 0, 0, 0, 80, 101, 101, 114, 85, 112, 100, 97, 116,
+101, 0, 1, 0, 0, 4, 0, 0, 0, 0, 1, 117, 112, 100, 97, 116,
+101, 0, 242, 255, 255, 255, 0, 254, 255, 255, 255, 0, 80,
+101, 101, 114, 65, 119, 97, 114, 101, 110, 101, 115, 115,
+0, 1, 0, 0, 4, 0, 0, 0, 0, 1, 97, 119, 97, 114, 101, 110,
+101, 115, 115, 0, 242, 255, 255, 255, 0, 254, 255, 255,
+255, 0, 80, 101, 101, 114, 82, 101, 113, 117, 101, 115,
+116, 83, 105, 110, 99, 101, 0, 1, 0, 0, 4, 0, 0, 0, 0, 1,
+102, 114, 111, 110, 116, 105, 101, 114, 115, 0, 242, 255,
+255, 255, 0, 254, 255, 255, 255, 0, 80, 101, 101, 114, 82,
+101, 113, 117, 101, 115, 116, 83, 110, 97, 112, 115, 104,
+111, 116, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 80, 101, 101, 114,
+82, 101, 103, 105, 115, 116, 101, 114, 73, 100, 0, 1, 0,
+0, 8, 0, 0, 0, 1, 1, 112, 101, 101, 114, 105, 100, 0, 249,
+255, 255, 255, 0, 70, 114, 111, 109, 80, 101, 101, 114, 0,
+3, 0, 5, 0, 0, 0, 5, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 3, 2,
+0, 0, 0, 4, 3, 0, 0, 0, 5, 4, 0, 0, 0, 82, 101, 109, 111,
+116, 101, 73, 110, 105, 116, 105, 97, 108, 83, 121, 110,
+99, 0, 1, 0, 0, 8, 0, 0, 0, 0, 2, 115, 110, 97, 112, 115,
+104, 111, 116, 0, 242, 255, 255, 255, 0, 254, 255, 255,
+255, 0, 97, 119, 97, 114, 101, 110, 101, 115, 115, 0, 242,
+255, 255, 255, 0, 254, 255, 255, 255, 0, 82, 101, 109,
+111, 116, 101, 85, 112, 100, 97, 116, 101, 0, 1, 0, 0, 4,
+0, 0, 0, 0, 1, 117, 112, 100, 97, 116, 101, 0, 242, 255,
+255, 255, 0, 254, 255, 255, 255, 0, 82, 101, 109, 111,
+116, 101, 65, 119, 97, 114, 101, 110, 101, 115, 115, 0, 1,
+0, 0, 4, 0, 0, 0, 0, 1, 97, 119, 97, 114, 101, 110, 101,
+115, 115, 0, 242, 255, 255, 255, 0, 254, 255, 255, 255, 0,
+82, 101, 109, 111, 116, 101, 83, 110, 97, 112, 115, 104,
+111, 116, 0, 1, 0, 0, 4, 0, 0, 0, 0, 1, 115, 110, 97, 112,
+115, 104, 111, 116, 0, 242, 255, 255, 255, 0, 254, 255,
+255, 255, 0, 82, 101, 109, 111, 116, 101, 85, 112, 100,
+97, 116, 101, 65, 99, 107, 0, 1, 0, 0, 4, 0, 0, 0, 0, 1,
+117, 112, 100, 97, 116, 101, 0, 242, 255, 255, 255, 0,
+254, 255, 255, 255, 0, 82, 101, 109, 111, 116, 101, 85,
+112, 100, 97, 116, 101, 83, 105, 110, 99, 101, 0, 1, 0, 0,
+8, 0, 0, 0, 0, 2, 117, 112, 100, 97, 116, 101, 0, 242,
+255, 255, 255, 0, 254, 255, 255, 255, 0, 102, 114, 111,
+110, 116, 105, 101, 114, 115, 0, 242, 255, 255, 255, 0,
+254, 255, 255, 255, 0, 70, 114, 111, 109, 82, 101, 109,
+111, 116, 101, 0, 3, 0, 9, 0, 0, 0, 6, 1, 6, 0, 0, 0, 2,
+7, 0, 0, 0, 3, 8, 0, 0, 0, 4, 9, 0, 0, 0, 5, 10, 0, 0, 0,
+6, 11, 0, 0, 0, 79, 112, 101, 114, 97, 116, 105, 111, 110,
+0, 1, 0, 0, 12, 0, 0, 0, 0, 2, 117, 112, 100, 97, 116,
+101, 0, 242, 255, 255, 255, 0, 254, 255, 255, 255, 0, 116,
+105, 109, 101, 115, 116, 97, 109, 112, 0, 243, 255, 255,
+255, 0, 79, 112, 101, 114, 97, 116, 105, 111, 110, 76,
+111, 103, 0, 1, 0, 0, 4, 0, 0, 0, 0, 1, 111, 112, 101,
+114, 97, 116, 105, 111, 110, 115, 0, 242, 255, 255, 255,
+0, 13, 0, 0, 0, 0, 73, 110, 105, 116, 105, 97, 108, 105,
+122, 101, 70, 114, 111, 109, 83, 110, 97, 112, 115, 104,
+111, 116, 82, 101, 113, 117, 101, 115, 116, 0, 1, 0, 0, 4,
+0, 0, 0, 0, 1, 115, 110, 97, 112, 115, 104, 111, 116, 0,
+242, 255, 255, 255, 0, 254, 255, 255, 255, 0, 0, 0, 0, 0
+]);
+
+export interface IPeerUpdate extends BebopRecord {
+
+ readonly update: Uint8Array;
+}
+
+export class PeerUpdate implements IPeerUpdate {
+ public readonly discriminator: number = 1 as 1;
+ public static readonly discriminator: number = 1 as 1;
+ public readonly update: Uint8Array;
+
+ constructor(record: IPeerUpdate) {
+ this.update = record.update;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return PeerUpdate.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IPeerUpdate): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ PeerUpdate.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link PeerUpdate}.
+ */
+ public static validateCompatibility(record: IPeerUpdate): void {
+ BebopTypeGuard.ensureArray(record.update, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link PeerUpdate} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IPeerUpdate {
+ return new PeerUpdate(record);
+ }
+
+ /**
+ * Creates a new {@link PeerUpdate} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IPeerUpdate {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`PeerUpdate.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ PeerUpdate.validateCompatibility(parsed);
+ return PeerUpdate.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return PeerUpdate.encode(this);
+ }
+
+ public static encode(record: IPeerUpdate): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ PeerUpdate.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IPeerUpdate, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.update);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IPeerUpdate {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return PeerUpdate.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IPeerUpdate {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IPeerUpdate = {
+ update: field0,
+ };
+ return new PeerUpdate(message);
+ }
+}
+
+
+export interface IPeerAwareness extends BebopRecord {
+
+ readonly awareness: Uint8Array;
+}
+
+export class PeerAwareness implements IPeerAwareness {
+ public readonly discriminator: number = 2 as 2;
+ public static readonly discriminator: number = 2 as 2;
+ public readonly awareness: Uint8Array;
+
+ constructor(record: IPeerAwareness) {
+ this.awareness = record.awareness;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return PeerAwareness.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IPeerAwareness): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ PeerAwareness.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link PeerAwareness}.
+ */
+ public static validateCompatibility(record: IPeerAwareness): void {
+ BebopTypeGuard.ensureArray(record.awareness, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link PeerAwareness} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IPeerAwareness {
+ return new PeerAwareness(record);
+ }
+
+ /**
+ * Creates a new {@link PeerAwareness} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IPeerAwareness {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`PeerAwareness.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ PeerAwareness.validateCompatibility(parsed);
+ return PeerAwareness.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return PeerAwareness.encode(this);
+ }
+
+ public static encode(record: IPeerAwareness): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ PeerAwareness.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IPeerAwareness, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.awareness);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IPeerAwareness {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return PeerAwareness.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IPeerAwareness {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IPeerAwareness = {
+ awareness: field0,
+ };
+ return new PeerAwareness(message);
+ }
+}
+
+
+export interface IPeerRequestSince extends BebopRecord {
+
+ readonly frontiers: Uint8Array;
+}
+
+export class PeerRequestSince implements IPeerRequestSince {
+ public readonly discriminator: number = 3 as 3;
+ public static readonly discriminator: number = 3 as 3;
+ public readonly frontiers: Uint8Array;
+
+ constructor(record: IPeerRequestSince) {
+ this.frontiers = record.frontiers;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return PeerRequestSince.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IPeerRequestSince): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ PeerRequestSince.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link PeerRequestSince}.
+ */
+ public static validateCompatibility(record: IPeerRequestSince): void {
+ BebopTypeGuard.ensureArray(record.frontiers, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link PeerRequestSince} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IPeerRequestSince {
+ return new PeerRequestSince(record);
+ }
+
+ /**
+ * Creates a new {@link PeerRequestSince} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IPeerRequestSince {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`PeerRequestSince.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ PeerRequestSince.validateCompatibility(parsed);
+ return PeerRequestSince.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return PeerRequestSince.encode(this);
+ }
+
+ public static encode(record: IPeerRequestSince): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ PeerRequestSince.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IPeerRequestSince, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.frontiers);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IPeerRequestSince {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return PeerRequestSince.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IPeerRequestSince {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IPeerRequestSince = {
+ frontiers: field0,
+ };
+ return new PeerRequestSince(message);
+ }
+}
+
+
+export interface IPeerRequestSnapshot extends BebopRecord {
+}
+
+export class PeerRequestSnapshot implements IPeerRequestSnapshot {
+ public readonly discriminator: number = 4 as 4;
+ public static readonly discriminator: number = 4 as 4;
+
+ constructor(record: IPeerRequestSnapshot) {
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return PeerRequestSnapshot.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IPeerRequestSnapshot): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ PeerRequestSnapshot.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link PeerRequestSnapshot}.
+ */
+ public static validateCompatibility(record: IPeerRequestSnapshot): void {
+
+ }
+
+ /**
+ * Unsafely creates an instance of {@link PeerRequestSnapshot} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IPeerRequestSnapshot {
+ return new PeerRequestSnapshot(record);
+ }
+
+ /**
+ * Creates a new {@link PeerRequestSnapshot} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IPeerRequestSnapshot {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`PeerRequestSnapshot.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ PeerRequestSnapshot.validateCompatibility(parsed);
+ return PeerRequestSnapshot.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return PeerRequestSnapshot.encode(this);
+ }
+
+ public static encode(record: IPeerRequestSnapshot): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ PeerRequestSnapshot.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IPeerRequestSnapshot, view: BebopView): number {
+ const before = view.length;
+
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IPeerRequestSnapshot {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return PeerRequestSnapshot.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IPeerRequestSnapshot {
+ let message: IPeerRequestSnapshot = {
+ };
+ return new PeerRequestSnapshot(message);
+ }
+}
+
+
+export interface IPeerRegisterId extends BebopRecord {
+
+ readonly peerid: bigint;
+}
+
+export class PeerRegisterId implements IPeerRegisterId {
+ public readonly discriminator: number = 5 as 5;
+ public static readonly discriminator: number = 5 as 5;
+ public readonly peerid: bigint;
+
+ constructor(record: IPeerRegisterId) {
+ this.peerid = record.peerid;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return PeerRegisterId.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IPeerRegisterId): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ PeerRegisterId.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link PeerRegisterId}.
+ */
+ public static validateCompatibility(record: IPeerRegisterId): void {
+ BebopTypeGuard.ensureUint64(record.peerid)
+ }
+
+ /**
+ * Unsafely creates an instance of {@link PeerRegisterId} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IPeerRegisterId {
+ return new PeerRegisterId(record);
+ }
+
+ /**
+ * Creates a new {@link PeerRegisterId} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IPeerRegisterId {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`PeerRegisterId.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ PeerRegisterId.validateCompatibility(parsed);
+ return PeerRegisterId.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return PeerRegisterId.encode(this);
+ }
+
+ public static encode(record: IPeerRegisterId): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ PeerRegisterId.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IPeerRegisterId, view: BebopView): number {
+ const before = view.length;
+ view.writeUint64(record.peerid);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IPeerRegisterId {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return PeerRegisterId.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IPeerRegisterId {
+ let field0: bigint;
+ field0 = view.readUint64();
+ let message: IPeerRegisterId = {
+ peerid: field0,
+ };
+ return new PeerRegisterId(message);
+ }
+}
+
+
+export type IFromPeerType
+ = { discriminator: 1, value: IPeerUpdate }
+ | { discriminator: 2, value: IPeerAwareness }
+ | { discriminator: 3, value: IPeerRequestSince }
+ | { discriminator: 4, value: IPeerRequestSnapshot }
+ | { discriminator: 5, value: IPeerRegisterId };
+
+export interface IFromPeer extends BebopRecord {
+ readonly data: IFromPeerType;
+}
+export class FromPeer implements IFromPeer {
+
+ public readonly data: IFromPeerType;
+
+ private constructor(data: IFromPeerType) {
+ this.data = data;
+ }
+
+ public get discriminator() {
+ return this.data.discriminator;
+ }
+
+ public get value() {
+ return this.data.value;
+ }
+
+ public static fromPeerUpdate(value: IPeerUpdate) {
+ return new FromPeer({ discriminator: 1, value: new PeerUpdate(value)});
+ }
+
+ public isPeerUpdate(): this is { value: PeerUpdate } & { data: Extract<IFromPeerType, { discriminator: 1 }> } {
+ return this.data.value instanceof PeerUpdate;
+ }
+
+ public static fromPeerAwareness(value: IPeerAwareness) {
+ return new FromPeer({ discriminator: 2, value: new PeerAwareness(value)});
+ }
+
+ public isPeerAwareness(): this is { value: PeerAwareness } & { data: Extract<IFromPeerType, { discriminator: 2 }> } {
+ return this.data.value instanceof PeerAwareness;
+ }
+
+ public static fromPeerRequestSince(value: IPeerRequestSince) {
+ return new FromPeer({ discriminator: 3, value: new PeerRequestSince(value)});
+ }
+
+ public isPeerRequestSince(): this is { value: PeerRequestSince } & { data: Extract<IFromPeerType, { discriminator: 3 }> } {
+ return this.data.value instanceof PeerRequestSince;
+ }
+
+ public static fromPeerRequestSnapshot(value: IPeerRequestSnapshot) {
+ return new FromPeer({ discriminator: 4, value: new PeerRequestSnapshot(value)});
+ }
+
+ public isPeerRequestSnapshot(): this is { value: PeerRequestSnapshot } & { data: Extract<IFromPeerType, { discriminator: 4 }> } {
+ return this.data.value instanceof PeerRequestSnapshot;
+ }
+
+ public static fromPeerRegisterId(value: IPeerRegisterId) {
+ return new FromPeer({ discriminator: 5, value: new PeerRegisterId(value)});
+ }
+
+ public isPeerRegisterId(): this is { value: PeerRegisterId } & { data: Extract<IFromPeerType, { discriminator: 5 }> } {
+ return this.data.value instanceof PeerRegisterId;
+ }
+
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return FromPeer.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IFromPeer): string {
+ delete (record.data.value as any).discriminator;
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ FromPeer.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link FromPeer}.
+ */
+ public static validateCompatibility(record: IFromPeer): void {
+ const discriminator = record.data.discriminator;
+ BebopTypeGuard.ensureUint8(discriminator);
+ switch (discriminator) {
+ case 1: {
+ PeerUpdate.validateCompatibility(record.data.value);
+ break;
+ }
+ case 2: {
+ PeerAwareness.validateCompatibility(record.data.value);
+ break;
+ }
+ case 3: {
+ PeerRequestSince.validateCompatibility(record.data.value);
+ break;
+ }
+ case 4: {
+ PeerRequestSnapshot.validateCompatibility(record.data.value);
+ break;
+ }
+ case 5: {
+ PeerRegisterId.validateCompatibility(record.data.value);
+ break;
+ }
+ default: {
+ throw new Error(`Unknown discriminator for FromPeer: ${discriminator}`);
+ }
+ }
+ }
+
+ /**
+ * Unsafely creates an instance of {@link FromPeer} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): FromPeer {
+ const discriminator = record.data.discriminator;
+ switch (discriminator) {
+ case 1: {
+ return new FromPeer({ discriminator: 1, value: PeerUpdate.unsafeCast(record.value) });
+ }
+ case 2: {
+ return new FromPeer({ discriminator: 2, value: PeerAwareness.unsafeCast(record.value) });
+ }
+ case 3: {
+ return new FromPeer({ discriminator: 3, value: PeerRequestSince.unsafeCast(record.value) });
+ }
+ case 4: {
+ return new FromPeer({ discriminator: 4, value: PeerRequestSnapshot.unsafeCast(record.value) });
+ }
+ case 5: {
+ return new FromPeer({ discriminator: 5, value: PeerRegisterId.unsafeCast(record.value) });
+ }
+ }
+ throw new BebopRuntimeError(`Failed to unsafely cast union from discriminator: ${discriminator}`);
+ }
+
+ /**
+ * Creates a new {@link FromPeer} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): FromPeer {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`FromPeer.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ FromPeer.validateCompatibility(parsed);
+ return FromPeer.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return FromPeer.encode(this);
+ }
+
+ public static encode(record: IFromPeer): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ FromPeer.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IFromPeer, view: BebopView): number {
+ const before = view.length;
+ const pos = view.reserveMessageLength();
+ const start = view.length + 1;
+ view.writeByte(record.data.discriminator);
+ switch (record.data.discriminator) {
+ case 1:
+ PeerUpdate.encodeInto(record.data.value, view);
+ break;
+ case 2:
+ PeerAwareness.encodeInto(record.data.value, view);
+ break;
+ case 3:
+ PeerRequestSince.encodeInto(record.data.value, view);
+ break;
+ case 4:
+ PeerRequestSnapshot.encodeInto(record.data.value, view);
+ break;
+ case 5:
+ PeerRegisterId.encodeInto(record.data.value, view);
+ break;
+ }
+ const end = view.length;
+ view.fillMessageLength(pos, end - start);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): FromPeer {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return FromPeer.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): FromPeer {
+ const length = view.readMessageLength();
+ const end = view.index + 1 + length;
+ switch (view.readByte()) {
+ case 1:
+ return this.fromPeerUpdate(PeerUpdate.readFrom(view));
+ case 2:
+ return this.fromPeerAwareness(PeerAwareness.readFrom(view));
+ case 3:
+ return this.fromPeerRequestSince(PeerRequestSince.readFrom(view));
+ case 4:
+ return this.fromPeerRequestSnapshot(PeerRequestSnapshot.readFrom(view));
+ case 5:
+ return this.fromPeerRegisterId(PeerRegisterId.readFrom(view));
+ default:
+ view.index = end;
+ throw new BebopRuntimeError("Unrecognized discriminator while decoding FromPeer");
+ }
+ }
+}
+
+
+export interface IRemoteInitialSync extends BebopRecord {
+
+ readonly snapshot: Uint8Array;
+
+ readonly awareness: Uint8Array;
+}
+
+export class RemoteInitialSync implements IRemoteInitialSync {
+ public readonly discriminator: number = 1 as 1;
+ public static readonly discriminator: number = 1 as 1;
+ public readonly snapshot: Uint8Array;
+ public readonly awareness: Uint8Array;
+
+ constructor(record: IRemoteInitialSync) {
+ this.snapshot = record.snapshot;
+ this.awareness = record.awareness;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteInitialSync.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteInitialSync): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteInitialSync.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteInitialSync}.
+ */
+ public static validateCompatibility(record: IRemoteInitialSync): void {
+ BebopTypeGuard.ensureArray(record.snapshot, BebopTypeGuard.ensureUint8);
+ BebopTypeGuard.ensureArray(record.awareness, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteInitialSync} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteInitialSync {
+ return new RemoteInitialSync(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteInitialSync} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteInitialSync {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteInitialSync.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteInitialSync.validateCompatibility(parsed);
+ return RemoteInitialSync.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteInitialSync.encode(this);
+ }
+
+ public static encode(record: IRemoteInitialSync): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteInitialSync.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteInitialSync, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.snapshot);
+ view.writeBytes(record.awareness);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteInitialSync {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteInitialSync.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteInitialSync {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let field1: Uint8Array;
+ field1 = view.readBytes();
+ let message: IRemoteInitialSync = {
+ snapshot: field0,
+ awareness: field1,
+ };
+ return new RemoteInitialSync(message);
+ }
+}
+
+
+export interface IRemoteUpdate extends BebopRecord {
+
+ readonly update: Uint8Array;
+}
+
+export class RemoteUpdate implements IRemoteUpdate {
+ public readonly discriminator: number = 2 as 2;
+ public static readonly discriminator: number = 2 as 2;
+ public readonly update: Uint8Array;
+
+ constructor(record: IRemoteUpdate) {
+ this.update = record.update;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteUpdate.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteUpdate): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteUpdate.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteUpdate}.
+ */
+ public static validateCompatibility(record: IRemoteUpdate): void {
+ BebopTypeGuard.ensureArray(record.update, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteUpdate} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteUpdate {
+ return new RemoteUpdate(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteUpdate} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteUpdate {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteUpdate.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteUpdate.validateCompatibility(parsed);
+ return RemoteUpdate.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteUpdate.encode(this);
+ }
+
+ public static encode(record: IRemoteUpdate): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteUpdate.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteUpdate, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.update);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteUpdate {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteUpdate.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteUpdate {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IRemoteUpdate = {
+ update: field0,
+ };
+ return new RemoteUpdate(message);
+ }
+}
+
+
+export interface IRemoteAwareness extends BebopRecord {
+
+ readonly awareness: Uint8Array;
+}
+
+export class RemoteAwareness implements IRemoteAwareness {
+ public readonly discriminator: number = 3 as 3;
+ public static readonly discriminator: number = 3 as 3;
+ public readonly awareness: Uint8Array;
+
+ constructor(record: IRemoteAwareness) {
+ this.awareness = record.awareness;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteAwareness.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteAwareness): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteAwareness.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteAwareness}.
+ */
+ public static validateCompatibility(record: IRemoteAwareness): void {
+ BebopTypeGuard.ensureArray(record.awareness, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteAwareness} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteAwareness {
+ return new RemoteAwareness(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteAwareness} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteAwareness {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteAwareness.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteAwareness.validateCompatibility(parsed);
+ return RemoteAwareness.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteAwareness.encode(this);
+ }
+
+ public static encode(record: IRemoteAwareness): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteAwareness.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteAwareness, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.awareness);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteAwareness {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteAwareness.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteAwareness {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IRemoteAwareness = {
+ awareness: field0,
+ };
+ return new RemoteAwareness(message);
+ }
+}
+
+
+export interface IRemoteSnapshot extends BebopRecord {
+
+ readonly snapshot: Uint8Array;
+}
+
+export class RemoteSnapshot implements IRemoteSnapshot {
+ public readonly discriminator: number = 4 as 4;
+ public static readonly discriminator: number = 4 as 4;
+ public readonly snapshot: Uint8Array;
+
+ constructor(record: IRemoteSnapshot) {
+ this.snapshot = record.snapshot;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteSnapshot.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteSnapshot): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteSnapshot.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteSnapshot}.
+ */
+ public static validateCompatibility(record: IRemoteSnapshot): void {
+ BebopTypeGuard.ensureArray(record.snapshot, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteSnapshot} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteSnapshot {
+ return new RemoteSnapshot(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteSnapshot} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteSnapshot {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteSnapshot.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteSnapshot.validateCompatibility(parsed);
+ return RemoteSnapshot.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteSnapshot.encode(this);
+ }
+
+ public static encode(record: IRemoteSnapshot): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteSnapshot.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteSnapshot, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.snapshot);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteSnapshot {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteSnapshot.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteSnapshot {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IRemoteSnapshot = {
+ snapshot: field0,
+ };
+ return new RemoteSnapshot(message);
+ }
+}
+
+
+export interface IRemoteUpdateAck extends BebopRecord {
+
+ readonly update: Uint8Array;
+}
+
+export class RemoteUpdateAck implements IRemoteUpdateAck {
+ public readonly discriminator: number = 5 as 5;
+ public static readonly discriminator: number = 5 as 5;
+ public readonly update: Uint8Array;
+
+ constructor(record: IRemoteUpdateAck) {
+ this.update = record.update;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteUpdateAck.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteUpdateAck): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteUpdateAck.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteUpdateAck}.
+ */
+ public static validateCompatibility(record: IRemoteUpdateAck): void {
+ BebopTypeGuard.ensureArray(record.update, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteUpdateAck} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteUpdateAck {
+ return new RemoteUpdateAck(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteUpdateAck} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteUpdateAck {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteUpdateAck.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteUpdateAck.validateCompatibility(parsed);
+ return RemoteUpdateAck.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteUpdateAck.encode(this);
+ }
+
+ public static encode(record: IRemoteUpdateAck): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteUpdateAck.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteUpdateAck, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.update);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteUpdateAck {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteUpdateAck.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteUpdateAck {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IRemoteUpdateAck = {
+ update: field0,
+ };
+ return new RemoteUpdateAck(message);
+ }
+}
+
+
+export interface IRemoteUpdateSince extends BebopRecord {
+
+ readonly update: Uint8Array;
+
+ readonly frontiers: Uint8Array;
+}
+
+export class RemoteUpdateSince implements IRemoteUpdateSince {
+ public readonly discriminator: number = 6 as 6;
+ public static readonly discriminator: number = 6 as 6;
+ public readonly update: Uint8Array;
+ public readonly frontiers: Uint8Array;
+
+ constructor(record: IRemoteUpdateSince) {
+ this.update = record.update;
+ this.frontiers = record.frontiers;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return RemoteUpdateSince.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IRemoteUpdateSince): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ RemoteUpdateSince.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link RemoteUpdateSince}.
+ */
+ public static validateCompatibility(record: IRemoteUpdateSince): void {
+ BebopTypeGuard.ensureArray(record.update, BebopTypeGuard.ensureUint8);
+ BebopTypeGuard.ensureArray(record.frontiers, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link RemoteUpdateSince} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IRemoteUpdateSince {
+ return new RemoteUpdateSince(record);
+ }
+
+ /**
+ * Creates a new {@link RemoteUpdateSince} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IRemoteUpdateSince {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`RemoteUpdateSince.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ RemoteUpdateSince.validateCompatibility(parsed);
+ return RemoteUpdateSince.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return RemoteUpdateSince.encode(this);
+ }
+
+ public static encode(record: IRemoteUpdateSince): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ RemoteUpdateSince.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IRemoteUpdateSince, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.update);
+ view.writeBytes(record.frontiers);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IRemoteUpdateSince {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return RemoteUpdateSince.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IRemoteUpdateSince {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let field1: Uint8Array;
+ field1 = view.readBytes();
+ let message: IRemoteUpdateSince = {
+ update: field0,
+ frontiers: field1,
+ };
+ return new RemoteUpdateSince(message);
+ }
+}
+
+
+export type IFromRemoteType
+ = { discriminator: 1, value: IRemoteInitialSync }
+ | { discriminator: 2, value: IRemoteUpdate }
+ | { discriminator: 3, value: IRemoteAwareness }
+ | { discriminator: 4, value: IRemoteSnapshot }
+ | { discriminator: 5, value: IRemoteUpdateAck }
+ | { discriminator: 6, value: IRemoteUpdateSince };
+
+export interface IFromRemote extends BebopRecord {
+ readonly data: IFromRemoteType;
+}
+export class FromRemote implements IFromRemote {
+
+ public readonly data: IFromRemoteType;
+
+ private constructor(data: IFromRemoteType) {
+ this.data = data;
+ }
+
+ public get discriminator() {
+ return this.data.discriminator;
+ }
+
+ public get value() {
+ return this.data.value;
+ }
+
+ public static fromRemoteInitialSync(value: IRemoteInitialSync) {
+ return new FromRemote({ discriminator: 1, value: new RemoteInitialSync(value)});
+ }
+
+ public isRemoteInitialSync(): this is { value: RemoteInitialSync } & { data: Extract<IFromRemoteType, { discriminator: 1 }> } {
+ return this.data.value instanceof RemoteInitialSync;
+ }
+
+ public static fromRemoteUpdate(value: IRemoteUpdate) {
+ return new FromRemote({ discriminator: 2, value: new RemoteUpdate(value)});
+ }
+
+ public isRemoteUpdate(): this is { value: RemoteUpdate } & { data: Extract<IFromRemoteType, { discriminator: 2 }> } {
+ return this.data.value instanceof RemoteUpdate;
+ }
+
+ public static fromRemoteAwareness(value: IRemoteAwareness) {
+ return new FromRemote({ discriminator: 3, value: new RemoteAwareness(value)});
+ }
+
+ public isRemoteAwareness(): this is { value: RemoteAwareness } & { data: Extract<IFromRemoteType, { discriminator: 3 }> } {
+ return this.data.value instanceof RemoteAwareness;
+ }
+
+ public static fromRemoteSnapshot(value: IRemoteSnapshot) {
+ return new FromRemote({ discriminator: 4, value: new RemoteSnapshot(value)});
+ }
+
+ public isRemoteSnapshot(): this is { value: RemoteSnapshot } & { data: Extract<IFromRemoteType, { discriminator: 4 }> } {
+ return this.data.value instanceof RemoteSnapshot;
+ }
+
+ public static fromRemoteUpdateAck(value: IRemoteUpdateAck) {
+ return new FromRemote({ discriminator: 5, value: new RemoteUpdateAck(value)});
+ }
+
+ public isRemoteUpdateAck(): this is { value: RemoteUpdateAck } & { data: Extract<IFromRemoteType, { discriminator: 5 }> } {
+ return this.data.value instanceof RemoteUpdateAck;
+ }
+
+ public static fromRemoteUpdateSince(value: IRemoteUpdateSince) {
+ return new FromRemote({ discriminator: 6, value: new RemoteUpdateSince(value)});
+ }
+
+ public isRemoteUpdateSince(): this is { value: RemoteUpdateSince } & { data: Extract<IFromRemoteType, { discriminator: 6 }> } {
+ return this.data.value instanceof RemoteUpdateSince;
+ }
+
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return FromRemote.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IFromRemote): string {
+ delete (record.data.value as any).discriminator;
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ FromRemote.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link FromRemote}.
+ */
+ public static validateCompatibility(record: IFromRemote): void {
+ const discriminator = record.data.discriminator;
+ BebopTypeGuard.ensureUint8(discriminator);
+ switch (discriminator) {
+ case 1: {
+ RemoteInitialSync.validateCompatibility(record.data.value);
+ break;
+ }
+ case 2: {
+ RemoteUpdate.validateCompatibility(record.data.value);
+ break;
+ }
+ case 3: {
+ RemoteAwareness.validateCompatibility(record.data.value);
+ break;
+ }
+ case 4: {
+ RemoteSnapshot.validateCompatibility(record.data.value);
+ break;
+ }
+ case 5: {
+ RemoteUpdateAck.validateCompatibility(record.data.value);
+ break;
+ }
+ case 6: {
+ RemoteUpdateSince.validateCompatibility(record.data.value);
+ break;
+ }
+ default: {
+ throw new Error(`Unknown discriminator for FromRemote: ${discriminator}`);
+ }
+ }
+ }
+
+ /**
+ * Unsafely creates an instance of {@link FromRemote} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): FromRemote {
+ const discriminator = record.data.discriminator;
+ switch (discriminator) {
+ case 1: {
+ return new FromRemote({ discriminator: 1, value: RemoteInitialSync.unsafeCast(record.value) });
+ }
+ case 2: {
+ return new FromRemote({ discriminator: 2, value: RemoteUpdate.unsafeCast(record.value) });
+ }
+ case 3: {
+ return new FromRemote({ discriminator: 3, value: RemoteAwareness.unsafeCast(record.value) });
+ }
+ case 4: {
+ return new FromRemote({ discriminator: 4, value: RemoteSnapshot.unsafeCast(record.value) });
+ }
+ case 5: {
+ return new FromRemote({ discriminator: 5, value: RemoteUpdateAck.unsafeCast(record.value) });
+ }
+ case 6: {
+ return new FromRemote({ discriminator: 6, value: RemoteUpdateSince.unsafeCast(record.value) });
+ }
+ }
+ throw new BebopRuntimeError(`Failed to unsafely cast union from discriminator: ${discriminator}`);
+ }
+
+ /**
+ * Creates a new {@link FromRemote} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): FromRemote {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`FromRemote.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ FromRemote.validateCompatibility(parsed);
+ return FromRemote.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return FromRemote.encode(this);
+ }
+
+ public static encode(record: IFromRemote): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ FromRemote.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IFromRemote, view: BebopView): number {
+ const before = view.length;
+ const pos = view.reserveMessageLength();
+ const start = view.length + 1;
+ view.writeByte(record.data.discriminator);
+ switch (record.data.discriminator) {
+ case 1:
+ RemoteInitialSync.encodeInto(record.data.value, view);
+ break;
+ case 2:
+ RemoteUpdate.encodeInto(record.data.value, view);
+ break;
+ case 3:
+ RemoteAwareness.encodeInto(record.data.value, view);
+ break;
+ case 4:
+ RemoteSnapshot.encodeInto(record.data.value, view);
+ break;
+ case 5:
+ RemoteUpdateAck.encodeInto(record.data.value, view);
+ break;
+ case 6:
+ RemoteUpdateSince.encodeInto(record.data.value, view);
+ break;
+ }
+ const end = view.length;
+ view.fillMessageLength(pos, end - start);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): FromRemote {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return FromRemote.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): FromRemote {
+ const length = view.readMessageLength();
+ const end = view.index + 1 + length;
+ switch (view.readByte()) {
+ case 1:
+ return this.fromRemoteInitialSync(RemoteInitialSync.readFrom(view));
+ case 2:
+ return this.fromRemoteUpdate(RemoteUpdate.readFrom(view));
+ case 3:
+ return this.fromRemoteAwareness(RemoteAwareness.readFrom(view));
+ case 4:
+ return this.fromRemoteSnapshot(RemoteSnapshot.readFrom(view));
+ case 5:
+ return this.fromRemoteUpdateAck(RemoteUpdateAck.readFrom(view));
+ case 6:
+ return this.fromRemoteUpdateSince(RemoteUpdateSince.readFrom(view));
+ default:
+ view.index = end;
+ throw new BebopRuntimeError("Unrecognized discriminator while decoding FromRemote");
+ }
+ }
+}
+
+
+export interface IOperation extends BebopRecord {
+
+ readonly update: Uint8Array;
+
+ readonly timestamp: Date;
+}
+
+export class Operation implements IOperation {
+ public readonly update: Uint8Array;
+ public readonly timestamp: Date;
+
+ constructor(record: IOperation) {
+ this.update = record.update;
+ this.timestamp = record.timestamp;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return Operation.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IOperation): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ Operation.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link Operation}.
+ */
+ public static validateCompatibility(record: IOperation): void {
+ BebopTypeGuard.ensureArray(record.update, BebopTypeGuard.ensureUint8);
+ BebopTypeGuard.ensureDate(record.timestamp)
+ }
+
+ /**
+ * Unsafely creates an instance of {@link Operation} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IOperation {
+ return new Operation(record);
+ }
+
+ /**
+ * Creates a new {@link Operation} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IOperation {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`Operation.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ Operation.validateCompatibility(parsed);
+ return Operation.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return Operation.encode(this);
+ }
+
+ public static encode(record: IOperation): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ Operation.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IOperation, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.update);
+ view.writeDate(record.timestamp);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IOperation {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return Operation.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IOperation {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let field1: Date;
+ field1 = view.readDate();
+ let message: IOperation = {
+ update: field0,
+ timestamp: field1,
+ };
+ return new Operation(message);
+ }
+}
+
+
+export interface IOperationLog extends BebopRecord {
+
+ readonly operations: Array<IOperation>;
+}
+
+export class OperationLog implements IOperationLog {
+ public readonly operations: Array<IOperation>;
+
+ constructor(record: IOperationLog) {
+ this.operations = record.operations;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return OperationLog.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IOperationLog): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ OperationLog.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link OperationLog}.
+ */
+ public static validateCompatibility(record: IOperationLog): void {
+ BebopTypeGuard.ensureArray(record.operations, Operation.validateCompatibility);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link OperationLog} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IOperationLog {
+ return new OperationLog(record);
+ }
+
+ /**
+ * Creates a new {@link OperationLog} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IOperationLog {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`OperationLog.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ OperationLog.validateCompatibility(parsed);
+ return OperationLog.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return OperationLog.encode(this);
+ }
+
+ public static encode(record: IOperationLog): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ OperationLog.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IOperationLog, view: BebopView): number {
+ const before = view.length;
+ {
+ const length0 = record.operations.length;
+ view.writeUint32(length0);
+ for (let i0 = 0; i0 < length0; i0++) {
+ Operation.encodeInto(record.operations[i0], view)
+ }
+ }
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IOperationLog {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return OperationLog.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IOperationLog {
+ let field0: Array<IOperation>;
+ {
+ let length0 = view.readUint32();
+ field0 = new Array<IOperation>(length0);
+ for (let i0 = 0; i0 < length0; i0++) {
+ let x0: IOperation;
+ x0 = Operation.readFrom(view);
+ field0[i0] = x0;
+ }
+ }
+ let message: IOperationLog = {
+ operations: field0,
+ };
+ return new OperationLog(message);
+ }
+}
+
+
+export interface IInitializeFromSnapshotRequest extends BebopRecord {
+
+ readonly snapshot: Uint8Array;
+}
+
+export class InitializeFromSnapshotRequest implements IInitializeFromSnapshotRequest {
+ public readonly snapshot: Uint8Array;
+
+ constructor(record: IInitializeFromSnapshotRequest) {
+ this.snapshot = record.snapshot;
+ }
+
+ /**
+ * Serializes the current instance into a JSON-Over-Bebop string
+ */
+ public stringify(): string {
+ return InitializeFromSnapshotRequest.encodeToJSON(this);
+ }
+
+ /**
+ * Serializes the specified object into a JSON-Over-Bebop string
+ */
+ public static encodeToJSON(record: IInitializeFromSnapshotRequest): string {
+ return JSON.stringify(record, BebopJson.replacer);
+ }
+
+ /**
+ * Validates that the runtime types of members in the current instance are correct.
+ */
+ public validateTypes(): void {
+ InitializeFromSnapshotRequest.validateCompatibility(this);
+ }
+
+ /**
+ * Validates that the specified dynamic object can become an instance of {@link InitializeFromSnapshotRequest}.
+ */
+ public static validateCompatibility(record: IInitializeFromSnapshotRequest): void {
+ BebopTypeGuard.ensureArray(record.snapshot, BebopTypeGuard.ensureUint8);
+ }
+
+ /**
+ * Unsafely creates an instance of {@link InitializeFromSnapshotRequest} from the specified dynamic object. No type checking is performed.
+ */
+ public static unsafeCast(record: any): IInitializeFromSnapshotRequest {
+ return new InitializeFromSnapshotRequest(record);
+ }
+
+ /**
+ * Creates a new {@link InitializeFromSnapshotRequest} instance from a JSON-Over-Bebop string. Type checking is performed.
+ */
+ public static fromJSON(json: string): IInitializeFromSnapshotRequest {
+ if (typeof json !== 'string' || json.trim().length === 0) {
+ throw new BebopRuntimeError(`InitializeFromSnapshotRequest.fromJSON: expected string`);
+ }
+ const parsed = JSON.parse(json, BebopJson.reviver);
+ InitializeFromSnapshotRequest.validateCompatibility(parsed);
+ return InitializeFromSnapshotRequest.unsafeCast(parsed);
+ }
+ public encode(): Uint8Array {
+ return InitializeFromSnapshotRequest.encode(this);
+ }
+
+ public static encode(record: IInitializeFromSnapshotRequest): Uint8Array {
+ const view = BebopView.getInstance();
+ view.startWriting();
+ InitializeFromSnapshotRequest.encodeInto(record, view);
+ return view.toArray();
+ }
+
+ public static encodeInto(record: IInitializeFromSnapshotRequest, view: BebopView): number {
+ const before = view.length;
+ view.writeBytes(record.snapshot);
+ const after = view.length;
+ return after - before;
+ }
+
+ public static decode(buffer: Uint8Array): IInitializeFromSnapshotRequest {
+ const view = BebopView.getInstance();
+ view.startReading(buffer);
+ return InitializeFromSnapshotRequest.readFrom(view);
+ }
+
+ public static readFrom(view: BebopView): IInitializeFromSnapshotRequest {
+ let field0: Uint8Array;
+ field0 = view.readBytes();
+ let message: IInitializeFromSnapshotRequest = {
+ snapshot: field0,
+ };
+ return new InitializeFromSnapshotRequest(message);
+ }
+}
+
diff --git a/rust/sync-service/bebop/schema.bop b/rust/sync-service/bebop/schema.bop
new file mode 100644
index 0000000000..30de889f02
--- /dev/null
+++ b/rust/sync-service/bebop/schema.bop
@@ -0,0 +1,52 @@
+union FromPeer {
+ 1 -> struct PeerUpdate {
+ byte[] update;
+ }
+ 2 -> struct PeerAwareness {
+ byte[] awareness;
+ }
+ 3 -> struct PeerRequestSince {
+ byte[] frontiers;
+ }
+ 4 -> struct PeerRequestSnapshot {}
+ 5 -> struct PeerRegisterId {
+ uint64 peerid;
+ }
+}
+
+union FromRemote {
+ 1 -> struct RemoteInitialSync {
+ byte[] snapshot;
+ byte[] awareness;
+ }
+ 2 -> struct RemoteUpdate {
+ byte[] update;
+ }
+ 3 -> struct RemoteAwareness {
+ byte[] awareness;
+ }
+ 4 -> struct RemoteSnapshot {
+ byte[] snapshot;
+ }
+ 5 -> struct RemoteUpdateAck {
+ byte[] update;
+ }
+ 6 -> struct RemoteUpdateSince {
+ byte[] update;
+ byte[] frontiers;
+ }
+}
+
+struct Operation {
+ byte[] update;
+ date timestamp;
+}
+
+struct OperationLog {
+ Operation[] operations;
+}
+
+struct InitializeFromSnapshotRequest {
+ byte[] snapshot;
+}
+
diff --git a/rust/sync-service/build.rs b/rust/sync-service/build.rs
new file mode 100644
index 0000000000..68835db3e0
--- /dev/null
+++ b/rust/sync-service/build.rs
@@ -0,0 +1,37 @@
+fn main() {
+ // use bebop_tools as bebop;
+ // bebop::download_bebopc(std::path::PathBuf::from("target").join("bebopc"));
+ // bebop::build_schema_dir("bebop", "src/generated", &bebop::BuildConfig::default());
+ include_git_in_env();
+}
+
+fn include_git_in_env() {
+ println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rerun-if-changed=.git/HEAD");
+ println!("cargo:rerun-if-changed=.git/refs");
+ let git_vers = match std::process::Command::new("git")
+ .args(["describe", "--tags", "--always"])
+ .output()
+ {
+ Ok(o) => {
+ if o.status.success() {
+ String::from_utf8_lossy(&o.stdout).trim().to_string()
+ } else {
+ let msg = format!(
+ "Running `git describe --tags --always` failed.
+stout: {}
+stderr: {}",
+ String::from_utf8_lossy(&o.stdout),
+ String::from_utf8_lossy(&o.stderr)
+ );
+ eprintln!("{msg}");
+ panic!("{msg}")
+ }
+ }
+ Err(e) => {
+ eprintln!("Running `git describe --tags --always` failed. Error: {e}");
+ panic!("Running `git describe --tags --always` failed. Error: {e}")
+ }
+ };
+ println!("cargo:rustc-env=GIT_DESCRIBE={}", git_vers);
+}
diff --git a/rust/sync-service/database/user-peer-mapping/migrations/0001_add_users.sql b/rust/sync-service/database/user-peer-mapping/migrations/0001_add_users.sql
new file mode 100644
index 0000000000..9e8179a28e
--- /dev/null
+++ b/rust/sync-service/database/user-peer-mapping/migrations/0001_add_users.sql
@@ -0,0 +1,10 @@
+CREATE TABLE peer_user_map (
+ document_id TEXT NOT NULL,
+ -- peer_id should be BIGINT, but d1 doesn't support this
+ peer_id TEXT NOT NULL,
+ user_id TEXT NOT NULL,
+ PRIMARY KEY (document_id, peer_id)
+);
+
+CREATE INDEX idx_peer_user_map_user_doc ON peer_user_map (document_id, user_id);
+CREATE INDEX idx_document_id ON peer_user_map (document_id);
diff --git a/rust/sync-service/justfile b/rust/sync-service/justfile
new file mode 100644
index 0000000000..8218f31564
--- /dev/null
+++ b/rust/sync-service/justfile
@@ -0,0 +1,39 @@
+export ENV := "local"
+
+worker-build: setup worker_build_setup
+ worker-build --features create-default-state,bebop-owned-all
+
+# rust both unit and e2e tests
+test: worker-build
+ npx vitest run
+ cargo test
+
+# Run tests without the alarm-keep-alive feature
+test-no-alarm: setup worker_build_setup
+ worker-build --release --no-default-features --features create-default-state,bebop-owned-all
+ npx vitest
+
+# run qa-env pointing to local worker
+debug: setup
+ npx wrangler dev &
+ cd ./qa-env && npm install && npm run dev
+
+setup:
+ npm install && cd bebop/ && npx bebopc build
+
+worker_build_setup:
+ cargo install worker-build
+
+# run worker using wrangler / miniflare
+dev:
+ npx wrangler dev
+
+# clean testing artifacts
+clean:
+ rm -rf node_modules .wrangler data
+
+deploy-dev:
+ npx wrangler deploy --env dev
+
+deploy-prod:
+ npx wrangler deploy --env prod
diff --git a/rust/sync-service/package-lock.json b/rust/sync-service/package-lock.json
new file mode 100644
index 0000000000..add09400b1
--- /dev/null
+++ b/rust/sync-service/package-lock.json
@@ -0,0 +1,3093 @@
+{
+ "name": "sync-service",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "bebop": "^3.1.3",
+ "jsonwebtoken": "^9.0.2",
+ "loro-crdt": "^1.5.1"
+ },
+ "devDependencies": {
+ "@cloudflare/vitest-pool-workers": "^0.9.3",
+ "@types/jsonwebtoken": "^9.0.9",
+ "bebop-tools": "^3.1.3",
+ "miniflare": "^3.20250224.0",
+ "vitest": "^3.0.8",
+ "wrangler": "^4.8.0"
+ }
+ },
+ "node_modules/@cloudflare/kv-asset-handler": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.4.0.tgz",
+ "integrity": "sha512-+tv3z+SPp+gqTIcImN9o0hqE9xyfQjI1XD9pL6NuKjua9B1y7mNYv0S9cP+QEbA4ppVgGZEmKOvHX5G5Ei1CVA==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "dependencies": {
+ "mime": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/@cloudflare/unenv-preset": {
+ "version": "2.7.4",
+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.7.4.tgz",
+ "integrity": "sha512-KIjbu/Dt50zseJIoOOK5y4eYpSojD9+xxkePYVK1Rg9k/p/st4YyMtz1Clju/zrenJHrOH+AAcjNArOPMwH4Bw==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "peerDependencies": {
+ "unenv": "2.0.0-rc.21",
+ "workerd": "^1.20250912.0"
+ },
+ "peerDependenciesMeta": {
+ "workerd": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@cloudflare/vitest-pool-workers": {
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/@cloudflare/vitest-pool-workers/-/vitest-pool-workers-0.9.3.tgz",
+ "integrity": "sha512-ElW5T3DSOPBvXCgIdWg93jHpxOlf3uBdjSboT+3/P9zMqsYowPCw6XEBJdTW2zRIIk2RTOkbnYucGNQG44d78Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "birpc": "0.2.14",
+ "cjs-module-lexer": "^1.2.3",
+ "devalue": "^5.3.2",
+ "miniflare": "4.20250917.0",
+ "semver": "^7.7.1",
+ "wrangler": "4.38.0",
+ "zod": "^3.22.3"
+ },
+ "peerDependencies": {
+ "@vitest/runner": "2.0.x - 3.2.x",
+ "@vitest/snapshot": "2.0.x - 3.2.x",
+ "vitest": "2.0.x - 3.2.x"
+ }
+ },
+ "node_modules/@cloudflare/vitest-pool-workers/node_modules/miniflare": {
+ "version": "4.20250917.0",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250917.0.tgz",
+ "integrity": "sha512-A7kYEc/Y6ohiiTji4W/qGJj3aJNc/9IMj/6wLy2phD/iMjcoY8t35654gR5mHbMx0AgUolDdr3HOsHB0cYBf+Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "acorn": "8.14.0",
+ "acorn-walk": "8.3.2",
+ "exit-hook": "2.2.1",
+ "glob-to-regexp": "0.4.1",
+ "sharp": "^0.33.5",
+ "stoppable": "1.1.0",
+ "undici": "7.14.0",
+ "workerd": "1.20250917.0",
+ "ws": "8.18.0",
+ "youch": "4.1.0-beta.10",
+ "zod": "3.22.3"
+ },
+ "bin": {
+ "miniflare": "bootstrap.js"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/@cloudflare/vitest-pool-workers/node_modules/undici": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.14.0.tgz",
+ "integrity": "sha512-Vqs8HTzjpQXZeXdpsfChQTlafcMQaaIwnGwLam1wudSSjlJeQ3bw1j+TLPePgrCnCpUXx7Ba5Pdpf5OBih62NQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-64": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250917.0.tgz",
+ "integrity": "sha512-0kL/kFnKUSycoo7b3PgM0nRyZ+1MGQAKaXtE6a2+SAeUkZ2FLnuFWmASi0s4rlWGsf/rlTw4AwXROePir9dUcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-arm64": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250917.0.tgz",
+ "integrity": "sha512-3/N1QmEJsC8Byxt1SGgVp5o0r+eKjuUEMbIL2yzLk/jrMdErPXy/DGf/tXZoACU68a/gMEbbT1itkYrm85iQHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-64": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250917.0.tgz",
+ "integrity": "sha512-E7sEow7CErbWY3olMmlbj6iss9r7Xb2uMyc+MKzYC9/J6yFlJd/dNHvjey9QIdxzbkC9qGe90a+KxQrjs+fspA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-arm64": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250917.0.tgz",
+ "integrity": "sha512-roOnRjxut2FUxo6HA9spbfs32naXAsnSQqsgku3iq6BYKv1QqGiFoY5bReK72N5uxmhxo7+RiTo8ZEkxA/vMIQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-windows-64": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250917.0.tgz",
+ "integrity": "sha512-gslh6Ou9+kshHjR1BJX47OsbPw3/cZCvGDompvaW/URCgr7aMzljbgmBb7p0uhwGy1qCXcIt31St6pd3IEcLng==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cowasm/memfs": {
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/@cowasm/memfs/-/memfs-3.5.1.tgz",
+ "integrity": "sha512-TSz00K+BdLxAYFQvwHmKgM/eAK6h9OYSQhPTcv/9XSyOF0Q90EtMkJvtwirwAXunfTsZw8R9YMu1UU213ooVKw==",
+ "dev": true,
+ "license": "Unlicense",
+ "dependencies": {
+ "fs-monkey": "^1.0.3"
+ },
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@emnapi/runtime": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz",
+ "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz",
+ "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz",
+ "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz",
+ "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz",
+ "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz",
+ "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz",
+ "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz",
+ "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz",
+ "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz",
+ "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz",
+ "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz",
+ "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz",
+ "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz",
+ "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz",
+ "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz",
+ "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz",
+ "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz",
+ "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz",
+ "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz",
+ "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz",
+ "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz",
+ "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz",
+ "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz",
+ "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@fastify/busboy": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
+ "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@img/sharp-darwin-arm64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz",
+ "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-arm64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-darwin-x64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz",
+ "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-x64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-arm64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz",
+ "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-x64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz",
+ "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz",
+ "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz",
+ "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-s390x": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz",
+ "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-x64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz",
+ "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz",
+ "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz",
+ "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz",
+ "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm": "1.0.5"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz",
+ "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-s390x": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz",
+ "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-s390x": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-x64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz",
+ "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-x64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-arm64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz",
+ "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-arm64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-x64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz",
+ "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-x64": "1.0.4"
+ }
+ },
+ "node_modules/@img/sharp-wasm32": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz",
+ "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==",
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/runtime": "^1.2.0"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-ia32": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz",
+ "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-x64": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz",
+ "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
+ "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@poppinss/colors": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.5.tgz",
+ "integrity": "sha512-FvdDqtcRCtz6hThExcFOgW0cWX+xwSMWcRuQe5ZEb2m7cVQOAVZOIMt+/v9RxGiD9/OY16qJBXK4CVKWAPalBw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^4.1.5"
+ }
+ },
+ "node_modules/@poppinss/dumper": {
+ "version": "0.6.4",
+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.4.tgz",
+ "integrity": "sha512-iG0TIdqv8xJ3Lt9O8DrPRxw1MRLjNpoqiSGU03P/wNLP/s0ra0udPJ1J2Tx5M0J3H/cVyEgpbn8xUKRY9j59kQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@sindresorhus/is": "^7.0.2",
+ "supports-color": "^10.0.0"
+ }
+ },
+ "node_modules/@poppinss/exception": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.2.tgz",
+ "integrity": "sha512-m7bpKCD4QMlFCjA/nKTs23fuvoVFoA83brRKmObCUNmi/9tVu8Ve3w4YQAnJu4q3Tjf5fr685HYIC/IA2zHRSg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.9.tgz",
+ "integrity": "sha512-qZdlImWXur0CFakn2BJ2znJOdqYZKiedEPEVNTBrpfPjc/YuTGcaYZcdmNFTkUj3DU0ZM/AElcM8Ybww3xVLzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.9.tgz",
+ "integrity": "sha512-4KW7P53h6HtJf5Y608T1ISKvNIYLWRKMvfnG0c44M6In4DQVU58HZFEVhWINDZKp7FZps98G3gxwC1sb0wXUUg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.9.tgz",
+ "integrity": "sha512-0CY3/K54slrzLDjOA7TOjN1NuLKERBgk9nY5V34mhmuu673YNb+7ghaDUs6N0ujXR7fz5XaS5Aa6d2TNxZd0OQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.9.tgz",
+ "integrity": "sha512-eOojSEAi/acnsJVYRxnMkPFqcxSMFfrw7r2iD9Q32SGkb/Q9FpUY1UlAu1DH9T7j++gZ0lHjnm4OyH2vCI7l7Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.9.tgz",
+ "integrity": "sha512-2lzjQPJbN5UnHm7bHIUKFMulGTQwdvOkouJDpPysJS+QFBGDJqcfh+CxxtG23Ik/9tEvnebQiylYoazFMAgrYw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.9.tgz",
+ "integrity": "sha512-SLl0hi2Ah2H7xQYd6Qaiu01kFPzQ+hqvdYSoOtHYg/zCIFs6t8sV95kaoqjzjFwuYQLtOI0RZre/Ke0nPaQV+g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.9.tgz",
+ "integrity": "sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.9.tgz",
+ "integrity": "sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.9.tgz",
+ "integrity": "sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.9.tgz",
+ "integrity": "sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.9.tgz",
+ "integrity": "sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.9.tgz",
+ "integrity": "sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.9.tgz",
+ "integrity": "sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.9.tgz",
+ "integrity": "sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.9.tgz",
+ "integrity": "sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.9.tgz",
+ "integrity": "sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.9.tgz",
+ "integrity": "sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.9.tgz",
+ "integrity": "sha512-KB48mPtaoHy1AwDNkAJfHXvHp24H0ryZog28spEs0V48l3H1fr4i37tiyHsgKZJnCmvxsbATdZGBpbmxTE3a9w==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.9.tgz",
+ "integrity": "sha512-AyleYRPU7+rgkMWbEh71fQlrzRfeP6SyMnRf9XX4fCdDPAJumdSBqYEcWPMzVQ4ScAl7E4oFfK0GUVn77xSwbw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@sindresorhus/is": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.1.0.tgz",
+ "integrity": "sha512-7F/yz2IphV39hiS2zB4QYVkivrptHHh0K8qJJd9HhuWSdvf8AN7NpebW3CcDZDBQsUPMoDKWsY2WWgW7bqOcfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/is?sponsor=1"
+ }
+ },
+ "node_modules/@speed-highlight/core": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.7.tgz",
+ "integrity": "sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
+ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/jsonwebtoken": {
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz",
+ "integrity": "sha512-uoe+GxEuHbvy12OUQct2X9JenKM3qAscquYymuQN4fMWG9DBQtykrQEFcAbVACF7qaLw9BePSodUL0kquqBJpQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/ms": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/ms": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
+ "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "22.14.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz",
+ "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@vitest/expect": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.8.tgz",
+ "integrity": "sha512-Xu6TTIavTvSSS6LZaA3EebWFr6tsoXPetOWNMOlc7LO88QVVBwq2oQWBoDiLCN6YTvNYsGSjqOO8CAdjom5DCQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "3.0.8",
+ "@vitest/utils": "3.0.8",
+ "chai": "^5.2.0",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.8.tgz",
+ "integrity": "sha512-n3LjS7fcW1BCoF+zWZxG7/5XvuYH+lsFg+BDwwAz0arIwHQJFUEsKBQ0BLU49fCxuM/2HSeBPHQD8WjgrxMfow==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "3.0.8",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.17"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0 || ^6.0.0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/pretty-format": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.8.tgz",
+ "integrity": "sha512-BNqwbEyitFhzYMYHUVbIvepOyeQOSFA/NeJMIP9enMntkkxLgOcgABH6fjyXG85ipTgvero6noreavGIqfJcIg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.8.tgz",
+ "integrity": "sha512-c7UUw6gEcOzI8fih+uaAXS5DwjlBaCJUo7KJ4VvJcjL95+DSR1kova2hFuRt3w41KZEFcOEiq098KkyrjXeM5w==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@vitest/utils": "3.0.8",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.8.tgz",
+ "integrity": "sha512-x8IlMGSEMugakInj44nUrLSILh/zy1f2/BgH0UeHpNyOocG18M9CWVIFBaXPt8TrqVZWmcPjwfG/ht5tnpba8A==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@vitest/pretty-format": "3.0.8",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/spy": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.8.tgz",
+ "integrity": "sha512-MR+PzJa+22vFKYb934CejhR4BeRpMSoxkvNoDit68GQxRLSf11aT6CTj3XaqUU9rxgWJFnqicN/wxw6yBRkI1Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyspy": "^3.0.2"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/utils": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.8.tgz",
+ "integrity": "sha512-nkBC3aEhfX2PdtQI/QwAWp8qZWwzASsU4Npbcd5RdMPBSSLCpkZp52P3xku3s3uA0HIEhGvEcF8rNkBsz9dQ4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.0.8",
+ "loupe": "^3.1.3",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@wapython/unionfs": {
+ "version": "4.5.7",
+ "resolved": "https://registry.npmjs.org/@wapython/unionfs/-/unionfs-4.5.7.tgz",
+ "integrity": "sha512-7809nAVelP9TqXCq5c1yCwymPreTXrK4n4q/zxOlQOIIz4PNmoQmIKiLnwkKk39GDnLmP1MvP9ZkBDyXCCmTfg==",
+ "dev": true,
+ "dependencies": {
+ "fs-monkey": "^1.0.0"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.14.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
+ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-walk": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz",
+ "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/as-table": {
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz",
+ "integrity": "sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "printable-characters": "^1.0.42"
+ }
+ },
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/bebop": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/bebop/-/bebop-3.1.3.tgz",
+ "integrity": "sha512-LkrEaxHnVbcpttF+tCMTv1nTqqsV88I31zsx/riWA6+r/nF6kmnvPjw00D4wxNfHvvASz+A8JmijeNGEuhzgQA==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/bebop-tools": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/bebop-tools/-/bebop-tools-3.1.3.tgz",
+ "integrity": "sha512-w+dxwGpsmVac/8SkNyCtdiz+PJLtO+4iwJGPd6PFAMw3VnmGRwM5ZZBXKGDc2nN7Yw6xqT/tySjNrpT/+evDYw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "wasi-js": "^1.7.3"
+ },
+ "bin": {
+ "bebopc": "dist/index.js"
+ }
+ },
+ "node_modules/birpc": {
+ "version": "0.2.14",
+ "resolved": "https://registry.npmjs.org/birpc/-/birpc-0.2.14.tgz",
+ "integrity": "sha512-37FHE8rqsYM5JEKCnXFyHpBCzvgHEExwVVTq+nUmloInU7l8ezD1TpOhKpS8oe1DTYFqEK27rFZVKG43oTqXRA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/blake3-wasm": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",
+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/buffer-equal-constant-time": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/chai": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz",
+ "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/check-error": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz",
+ "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ }
+ },
+ "node_modules/cjs-module-lexer": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz",
+ "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/color": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1",
+ "color-string": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=12.5.0"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/color-string": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "^1.0.0",
+ "simple-swizzle": "^0.2.2"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
+ "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/data-uri-to-buffer": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz",
+ "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/debug": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+ "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/defu": {
+ "version": "6.1.4",
+ "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
+ "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/detect-libc": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz",
+ "integrity": "sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/devalue": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.3.2.tgz",
+ "integrity": "sha512-UDsjUbpQn9kvm68slnrs+mfxwFkIflOhkanmyabZ8zOYk8SMEIbJ3TK+88g70hSIeytu4y18f0z/hYHMTrXIWw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/ecdsa-sig-formatter": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/error-stack-parser-es": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",
+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz",
+ "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz",
+ "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.4",
+ "@esbuild/android-arm": "0.25.4",
+ "@esbuild/android-arm64": "0.25.4",
+ "@esbuild/android-x64": "0.25.4",
+ "@esbuild/darwin-arm64": "0.25.4",
+ "@esbuild/darwin-x64": "0.25.4",
+ "@esbuild/freebsd-arm64": "0.25.4",
+ "@esbuild/freebsd-x64": "0.25.4",
+ "@esbuild/linux-arm": "0.25.4",
+ "@esbuild/linux-arm64": "0.25.4",
+ "@esbuild/linux-ia32": "0.25.4",
+ "@esbuild/linux-loong64": "0.25.4",
+ "@esbuild/linux-mips64el": "0.25.4",
+ "@esbuild/linux-ppc64": "0.25.4",
+ "@esbuild/linux-riscv64": "0.25.4",
+ "@esbuild/linux-s390x": "0.25.4",
+ "@esbuild/linux-x64": "0.25.4",
+ "@esbuild/netbsd-arm64": "0.25.4",
+ "@esbuild/netbsd-x64": "0.25.4",
+ "@esbuild/openbsd-arm64": "0.25.4",
+ "@esbuild/openbsd-x64": "0.25.4",
+ "@esbuild/sunos-x64": "0.25.4",
+ "@esbuild/win32-arm64": "0.25.4",
+ "@esbuild/win32-ia32": "0.25.4",
+ "@esbuild/win32-x64": "0.25.4"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/exit-hook": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz",
+ "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/expect-type": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.0.tgz",
+ "integrity": "sha512-80F22aiJ3GLyVnS/B3HzgR6RelZVumzj9jkL0Rhz4h0xYbNW9PjlQz5h3J/SShErbXBc295vseR4/MIbVmUbeA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/exsolve": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.7.tgz",
+ "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fflate": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.4.tgz",
+ "integrity": "sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fs-monkey": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz",
+ "integrity": "sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==",
+ "dev": true,
+ "license": "Unlicense"
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/get-source": {
+ "version": "2.0.12",
+ "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz",
+ "integrity": "sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==",
+ "dev": true,
+ "license": "Unlicense",
+ "dependencies": {
+ "data-uri-to-buffer": "^2.0.0",
+ "source-map": "^0.6.1"
+ }
+ },
+ "node_modules/glob-to-regexp": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
+ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
+ "dev": true,
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/is-arrayish": {
+ "version": "0.3.4",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz",
+ "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/jsonwebtoken": {
+ "version": "9.0.2",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz",
+ "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==",
+ "license": "MIT",
+ "dependencies": {
+ "jws": "^3.2.2",
+ "lodash.includes": "^4.3.0",
+ "lodash.isboolean": "^3.0.3",
+ "lodash.isinteger": "^4.0.4",
+ "lodash.isnumber": "^3.0.3",
+ "lodash.isplainobject": "^4.0.6",
+ "lodash.isstring": "^4.0.1",
+ "lodash.once": "^4.0.0",
+ "ms": "^2.1.1",
+ "semver": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/jwa": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz",
+ "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer-equal-constant-time": "^1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jws": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz",
+ "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==",
+ "license": "MIT",
+ "dependencies": {
+ "jwa": "^1.4.2",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/lodash.includes": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+ "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isboolean": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+ "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isinteger": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+ "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isnumber": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+ "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isplainobject": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+ "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isstring": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.once": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
+ "license": "MIT"
+ },
+ "node_modules/loro-crdt": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/loro-crdt/-/loro-crdt-1.5.1.tgz",
+ "integrity": "sha512-Q7KEuzx/nS/pr8+pjyaz5xBxR7eUGAn42keoQ3j3JmgSW1APgWyjLFUbiahBjNm16+HQrde8By/0jCker7XBYQ==",
+ "license": "MIT"
+ },
+ "node_modules/loupe": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz",
+ "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.17",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",
+ "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0"
+ }
+ },
+ "node_modules/mime": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",
+ "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/miniflare": {
+ "version": "3.20250408.1",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20250408.1.tgz",
+ "integrity": "sha512-0EHBNcd1yZSdTC/7GSe/kI1ge4+YuO/6QbEXDLtnVgUExKiMS5brfWsza1+Ps0/WCywKkER08lJwu6tFh7kF7g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "acorn": "8.14.0",
+ "acorn-walk": "8.3.2",
+ "exit-hook": "2.2.1",
+ "glob-to-regexp": "0.4.1",
+ "stoppable": "1.1.0",
+ "undici": "^5.28.5",
+ "workerd": "1.20250408.0",
+ "ws": "8.18.0",
+ "youch": "3.3.4",
+ "zod": "3.22.3"
+ },
+ "bin": {
+ "miniflare": "bootstrap.js"
+ },
+ "engines": {
+ "node": ">=16.13"
+ }
+ },
+ "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-64": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250408.0.tgz",
+ "integrity": "sha512-bxhIwBWxaNItZLXDNOKY2dCv0FHjDiDkfJFpwv4HvtvU5MKcrivZHVmmfDzLW85rqzfcDOmKbZeMPVfiKxdBZw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-arm64": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250408.0.tgz",
+ "integrity": "sha512-5XZ2Oykr8bSo7zBmERtHh18h5BZYC/6H1YFWVxEj3PtalF3+6SHsO4KZsbGvDml9Pu7sHV277jiZE5eny8Hlyw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-64": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250408.0.tgz",
+ "integrity": "sha512-WbgItXWln6G5d7GvYLWcuOzAVwafysZaWunH3UEfsm95wPuRofpYnlDD861gdWJX10IHSVgMStGESUcs7FLerQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-arm64": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250408.0.tgz",
+ "integrity": "sha512-pAhEywPPvr92SLylnQfZEPgXz+9pOG9G9haAPLpEatncZwYiYd9yiR6HYWhKp2erzCoNrOqKg9IlQwU3z1IDiw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/miniflare/node_modules/@cloudflare/workerd-windows-64": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250408.0.tgz",
+ "integrity": "sha512-nJ3RjMKGae2aF2rZ/CNeBvQPM+W5V1SUK0FYWG/uomyr7uQ2l4IayHna1ODg/OHHTEgIjwom0Mbn58iXb0WOcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/miniflare/node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/miniflare/node_modules/workerd": {
+ "version": "1.20250408.0",
+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250408.0.tgz",
+ "integrity": "sha512-bBUX+UsvpzAqiWFNeZrlZmDGddiGZdBBbftZJz2wE6iUg/cIAJeVQYTtS/3ahaicguoLBz4nJiDo8luqM9fx1A==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "workerd": "bin/workerd"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "@cloudflare/workerd-darwin-64": "1.20250408.0",
+ "@cloudflare/workerd-darwin-arm64": "1.20250408.0",
+ "@cloudflare/workerd-linux-64": "1.20250408.0",
+ "@cloudflare/workerd-linux-arm64": "1.20250408.0",
+ "@cloudflare/workerd-windows-64": "1.20250408.0"
+ }
+ },
+ "node_modules/miniflare/node_modules/youch": {
+ "version": "3.3.4",
+ "resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz",
+ "integrity": "sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cookie": "^0.7.1",
+ "mustache": "^4.2.0",
+ "stacktracey": "^2.1.8"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/mustache": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
+ "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "mustache": "bin/mustache"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+ "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/ohash": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz",
+ "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/path-browserify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/path-to-regexp": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
+ "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathval": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz",
+ "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.3",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
+ "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.8",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/printable-characters": {
+ "version": "1.0.42",
+ "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz",
+ "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==",
+ "dev": true,
+ "license": "Unlicense"
+ },
+ "node_modules/randombytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/randomfill": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
+ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "randombytes": "^2.0.5",
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.34.9",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.9.tgz",
+ "integrity": "sha512-nF5XYqWWp9hx/LrpC8sZvvvmq0TeTjQgaZHYmAgwysT9nh8sWnZhBnM8ZyVbbJFIQBLwHDNoMqsBZBbUo4U8sQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.6"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.34.9",
+ "@rollup/rollup-android-arm64": "4.34.9",
+ "@rollup/rollup-darwin-arm64": "4.34.9",
+ "@rollup/rollup-darwin-x64": "4.34.9",
+ "@rollup/rollup-freebsd-arm64": "4.34.9",
+ "@rollup/rollup-freebsd-x64": "4.34.9",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.34.9",
+ "@rollup/rollup-linux-arm-musleabihf": "4.34.9",
+ "@rollup/rollup-linux-arm64-gnu": "4.34.9",
+ "@rollup/rollup-linux-arm64-musl": "4.34.9",
+ "@rollup/rollup-linux-loongarch64-gnu": "4.34.9",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.34.9",
+ "@rollup/rollup-linux-riscv64-gnu": "4.34.9",
+ "@rollup/rollup-linux-s390x-gnu": "4.34.9",
+ "@rollup/rollup-linux-x64-gnu": "4.34.9",
+ "@rollup/rollup-linux-x64-musl": "4.34.9",
+ "@rollup/rollup-win32-arm64-msvc": "4.34.9",
+ "@rollup/rollup-win32-ia32-msvc": "4.34.9",
+ "@rollup/rollup-win32-x64-msvc": "4.34.9",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/semver": {
+ "version": "7.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
+ "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/sharp": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz",
+ "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "color": "^4.2.3",
+ "detect-libc": "^2.0.3",
+ "semver": "^7.6.3"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-darwin-arm64": "0.33.5",
+ "@img/sharp-darwin-x64": "0.33.5",
+ "@img/sharp-libvips-darwin-arm64": "1.0.4",
+ "@img/sharp-libvips-darwin-x64": "1.0.4",
+ "@img/sharp-libvips-linux-arm": "1.0.5",
+ "@img/sharp-libvips-linux-arm64": "1.0.4",
+ "@img/sharp-libvips-linux-s390x": "1.0.4",
+ "@img/sharp-libvips-linux-x64": "1.0.4",
+ "@img/sharp-libvips-linuxmusl-arm64": "1.0.4",
+ "@img/sharp-libvips-linuxmusl-x64": "1.0.4",
+ "@img/sharp-linux-arm": "0.33.5",
+ "@img/sharp-linux-arm64": "0.33.5",
+ "@img/sharp-linux-s390x": "0.33.5",
+ "@img/sharp-linux-x64": "0.33.5",
+ "@img/sharp-linuxmusl-arm64": "0.33.5",
+ "@img/sharp-linuxmusl-x64": "0.33.5",
+ "@img/sharp-wasm32": "0.33.5",
+ "@img/sharp-win32-ia32": "0.33.5",
+ "@img/sharp-win32-x64": "0.33.5"
+ }
+ },
+ "node_modules/siginfo": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/simple-swizzle": {
+ "version": "0.2.4",
+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz",
+ "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-arrayish": "^0.3.1"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stackback": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/stacktracey": {
+ "version": "2.1.8",
+ "resolved": "https://registry.npmjs.org/stacktracey/-/stacktracey-2.1.8.tgz",
+ "integrity": "sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==",
+ "dev": true,
+ "license": "Unlicense",
+ "dependencies": {
+ "as-table": "^1.0.36",
+ "get-source": "^2.0.12"
+ }
+ },
+ "node_modules/std-env": {
+ "version": "3.8.1",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.1.tgz",
+ "integrity": "sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/stoppable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
+ "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
+ "node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.15",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tinypool": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz",
+ "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ }
+ },
+ "node_modules/tinyrainbow": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+ "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tinyspy": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz",
+ "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "dev": true,
+ "license": "0BSD",
+ "optional": true
+ },
+ "node_modules/typedarray-to-buffer": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz",
+ "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/ufo": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz",
+ "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/undici": {
+ "version": "5.29.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
+ "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@fastify/busboy": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.0"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/unenv": {
+ "version": "2.0.0-rc.21",
+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.21.tgz",
+ "integrity": "sha512-Wj7/AMtE9MRnAXa6Su3Lk0LNCfqDYgfwVjwRFVum9U7wsto1imuHqk4kTm7Jni+5A0Hn7dttL6O/zjvUvoo+8A==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "defu": "^6.1.4",
+ "exsolve": "^1.0.7",
+ "ohash": "^2.0.11",
+ "pathe": "^2.0.3",
+ "ufo": "^1.6.1"
+ }
+ },
+ "node_modules/vite": {
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz",
+ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "esbuild": "^0.25.0",
+ "fdir": "^6.4.4",
+ "picomatch": "^4.0.2",
+ "postcss": "^8.5.3",
+ "rollup": "^4.34.9",
+ "tinyglobby": "^0.2.13"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "jiti": ">=1.21.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.8.tgz",
+ "integrity": "sha512-6PhR4H9VGlcwXZ+KWCdMqbtG649xCPZqfI9j2PsK1FcXgEzro5bGHcVKFCTqPLaNKZES8Evqv4LwvZARsq5qlg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.0",
+ "es-module-lexer": "^1.6.0",
+ "pathe": "^2.0.3",
+ "vite": "^5.0.0 || ^6.0.0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vitest": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.8.tgz",
+ "integrity": "sha512-dfqAsNqRGUc8hB9OVR2P0w8PZPEckti2+5rdZip0WIz9WW0MnImJ8XiR61QhqLa92EQzKP2uPkzenKOAHyEIbA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@vitest/expect": "3.0.8",
+ "@vitest/mocker": "3.0.8",
+ "@vitest/pretty-format": "^3.0.8",
+ "@vitest/runner": "3.0.8",
+ "@vitest/snapshot": "3.0.8",
+ "@vitest/spy": "3.0.8",
+ "@vitest/utils": "3.0.8",
+ "chai": "^5.2.0",
+ "debug": "^4.4.0",
+ "expect-type": "^1.1.0",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3",
+ "std-env": "^3.8.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinypool": "^1.0.2",
+ "tinyrainbow": "^2.0.0",
+ "vite": "^5.0.0 || ^6.0.0",
+ "vite-node": "3.0.8",
+ "why-is-node-running": "^2.3.0"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "@vitest/browser": "3.0.8",
+ "@vitest/ui": "3.0.8",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/debug": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/wasi-js": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/wasi-js/-/wasi-js-1.7.3.tgz",
+ "integrity": "sha512-4oq6iVdY4nlsqFviS98ltEdWnhYQoeZwz3/5AxQ3bs0fd/YBzBMS162p/n0DHEIJFev1Jvk3gnJwck1s4a8mVQ==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cowasm/memfs": "^3.5.1",
+ "@wapython/unionfs": "^4.5.7",
+ "debug": "^4.3.4",
+ "fflate": "^0.7.3",
+ "path-browserify": "^1.0.0",
+ "randomfill": "^1.0.4",
+ "typedarray-to-buffer": "^4.0.0"
+ },
+ "bin": {
+ "wasi-run": "bin/run.js"
+ }
+ },
+ "node_modules/why-is-node-running": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "siginfo": "^2.0.0",
+ "stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/workerd": {
+ "version": "1.20250917.0",
+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250917.0.tgz",
+ "integrity": "sha512-0D+wWaccyYQb2Zx2DZDC77YDn9kOpkpGMCgyKgIHilghut5hBQ/adUIEseS4iuIZxBPeFSn6zFtICP0SxZ3z0g==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "workerd": "bin/workerd"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "@cloudflare/workerd-darwin-64": "1.20250917.0",
+ "@cloudflare/workerd-darwin-arm64": "1.20250917.0",
+ "@cloudflare/workerd-linux-64": "1.20250917.0",
+ "@cloudflare/workerd-linux-arm64": "1.20250917.0",
+ "@cloudflare/workerd-windows-64": "1.20250917.0"
+ }
+ },
+ "node_modules/wrangler": {
+ "version": "4.38.0",
+ "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.38.0.tgz",
+ "integrity": "sha512-ITL4VZ4KWs8LMDEttDTrAKLktwtv1NxHBd5QIqHOczvcjnAQr+GQoE6XYQws+w8jlOjDV7KyvbFqAdyRh5om3g==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "dependencies": {
+ "@cloudflare/kv-asset-handler": "0.4.0",
+ "@cloudflare/unenv-preset": "2.7.4",
+ "blake3-wasm": "2.1.5",
+ "esbuild": "0.25.4",
+ "miniflare": "4.20250917.0",
+ "path-to-regexp": "6.3.0",
+ "unenv": "2.0.0-rc.21",
+ "workerd": "1.20250917.0"
+ },
+ "bin": {
+ "wrangler": "bin/wrangler.js",
+ "wrangler2": "bin/wrangler.js"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "@cloudflare/workers-types": "^4.20250917.0"
+ },
+ "peerDependenciesMeta": {
+ "@cloudflare/workers-types": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/wrangler/node_modules/miniflare": {
+ "version": "4.20250917.0",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250917.0.tgz",
+ "integrity": "sha512-A7kYEc/Y6ohiiTji4W/qGJj3aJNc/9IMj/6wLy2phD/iMjcoY8t35654gR5mHbMx0AgUolDdr3HOsHB0cYBf+Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "acorn": "8.14.0",
+ "acorn-walk": "8.3.2",
+ "exit-hook": "2.2.1",
+ "glob-to-regexp": "0.4.1",
+ "sharp": "^0.33.5",
+ "stoppable": "1.1.0",
+ "undici": "7.14.0",
+ "workerd": "1.20250917.0",
+ "ws": "8.18.0",
+ "youch": "4.1.0-beta.10",
+ "zod": "3.22.3"
+ },
+ "bin": {
+ "miniflare": "bootstrap.js"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/wrangler/node_modules/undici": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.14.0.tgz",
+ "integrity": "sha512-Vqs8HTzjpQXZeXdpsfChQTlafcMQaaIwnGwLam1wudSSjlJeQ3bw1j+TLPePgrCnCpUXx7Ba5Pdpf5OBih62NQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/youch": {
+ "version": "4.1.0-beta.10",
+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",
+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@poppinss/dumper": "^0.6.4",
+ "@speed-highlight/core": "^1.2.7",
+ "cookie": "^1.0.2",
+ "youch-core": "^0.3.3"
+ }
+ },
+ "node_modules/youch-core": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",
+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/exception": "^1.2.2",
+ "error-stack-parser-es": "^1.0.5"
+ }
+ },
+ "node_modules/zod": {
+ "version": "3.22.3",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.3.tgz",
+ "integrity": "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ }
+ }
+}
diff --git a/rust/sync-service/package.json b/rust/sync-service/package.json
new file mode 100644
index 0000000000..33b989d078
--- /dev/null
+++ b/rust/sync-service/package.json
@@ -0,0 +1,15 @@
+{
+ "devDependencies": {
+ "@cloudflare/vitest-pool-workers": "^0.9.3",
+ "@types/jsonwebtoken": "^9.0.9",
+ "bebop-tools": "^3.1.3",
+ "miniflare": "^3.20250224.0",
+ "vitest": "^3.0.8",
+ "wrangler": "^4.8.0"
+ },
+ "dependencies": {
+ "bebop": "^3.1.3",
+ "jsonwebtoken": "^9.0.2",
+ "loro-crdt": "^1.5.1"
+ }
+}
diff --git a/rust/sync-service/qa-env/.gitignore b/rust/sync-service/qa-env/.gitignore
new file mode 100644
index 0000000000..76add878f8
--- /dev/null
+++ b/rust/sync-service/qa-env/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+dist
\ No newline at end of file
diff --git a/rust/sync-service/qa-env/README.md b/rust/sync-service/qa-env/README.md
new file mode 100644
index 0000000000..6a17645366
--- /dev/null
+++ b/rust/sync-service/qa-env/README.md
@@ -0,0 +1,34 @@
+## Usage
+
+Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
+
+This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
+
+```bash
+$ npm install # or pnpm install or yarn install
+```
+
+### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm run dev` or `npm start`
+
+Runs the app in the development mode.<br>
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+
+The page will reload if you make edits.<br>
+
+### `npm run build`
+
+Builds the app for production to the `dist` folder.<br>
+It correctly bundles Solid in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.<br>
+Your app is ready to be deployed!
+
+## Deployment
+
+You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
diff --git a/rust/sync-service/qa-env/bun.lock b/rust/sync-service/qa-env/bun.lock
new file mode 100644
index 0000000000..da18cbaf41
--- /dev/null
+++ b/rust/sync-service/qa-env/bun.lock
@@ -0,0 +1,737 @@
+{
+ "lockfileVersion": 1,
+ "configVersion": 0,
+ "workspaces": {
+ "": {
+ "name": "vite-template-solid",
+ "dependencies": {
+ "@babel/helpers": "^7.28.4",
+ "@tailwindcss/vite": "^4.0.12",
+ "jose": "^6.0.10",
+ "loro-crdt": "^1.4.6",
+ "solid-js": "^1.9.5",
+ "tailwindcss": "^4.0.12",
+ "vite-plugin-node-polyfills": "^0.23.0",
+ "vite-plugin-top-level-await": "^1.5.0",
+ "vite-plugin-wasm": "^3.4.1",
+ },
+ "devDependencies": {
+ "typescript": "^5.7.2",
+ "vite": "^6.4.1",
+ "vite-plugin-solid": "^2.11.6",
+ },
+ },
+ },
+ "overrides": {
+ "@babel/helpers": ">=7.26.10",
+ },
+ "packages": {
+ "@ampproject/remapping": ["@ampproject/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
+
+ "@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ=="],
+
+ "@babel/compat-data": ["@babel/[email protected]", "", {}, "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ=="],
+
+ "@babel/core": ["@babel/[email protected]", "", { "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.9", "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", "@babel/helpers": "^7.26.9", "@babel/parser": "^7.26.9", "@babel/template": "^7.26.9", "@babel/traverse": "^7.26.9", "@babel/types": "^7.26.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw=="],
+
+ "@babel/generator": ["@babel/[email protected]", "", { "dependencies": { "@babel/parser": "^7.26.9", "@babel/types": "^7.26.9", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" } }, "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg=="],
+
+ "@babel/helper-compilation-targets": ["@babel/[email protected]", "", { "dependencies": { "@babel/compat-data": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA=="],
+
+ "@babel/helper-module-imports": ["@babel/[email protected]", "", { "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" } }, "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw=="],
+
+ "@babel/helper-module-transforms": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw=="],
+
+ "@babel/helper-plugin-utils": ["@babel/[email protected]", "", {}, "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg=="],
+
+ "@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
+
+ "@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
+
+ "@babel/helper-validator-option": ["@babel/[email protected]", "", {}, "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw=="],
+
+ "@babel/helpers": ["@babel/[email protected]", "", { "dependencies": { "@babel/template": "^7.27.2", "@babel/types": "^7.28.4" } }, "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w=="],
+
+ "@babel/parser": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.26.9" }, "bin": { "parser": "bin/babel-parser.js" } }, "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A=="],
+
+ "@babel/plugin-syntax-jsx": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA=="],
+
+ "@babel/template": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/parser": "^7.27.2", "@babel/types": "^7.27.1" } }, "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw=="],
+
+ "@babel/traverse": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.9", "@babel/parser": "^7.26.9", "@babel/template": "^7.26.9", "@babel/types": "^7.26.9", "debug": "^4.3.1", "globals": "^11.1.0" } }, "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg=="],
+
+ "@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA=="],
+
+ "@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ=="],
+
+ "@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g=="],
+
+ "@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g=="],
+
+ "@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg=="],
+
+ "@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw=="],
+
+ "@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg=="],
+
+ "@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w=="],
+
+ "@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A=="],
+
+ "@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg=="],
+
+ "@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg=="],
+
+ "@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg=="],
+
+ "@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw=="],
+
+ "@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ=="],
+
+ "@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw=="],
+
+ "@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA=="],
+
+ "@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA=="],
+
+ "@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw=="],
+
+ "@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw=="],
+
+ "@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA=="],
+
+ "@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw=="],
+
+ "@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg=="],
+
+ "@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg=="],
+
+ "@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw=="],
+
+ "@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA=="],
+
+ "@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ=="],
+
+ "@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA=="],
+
+ "@jridgewell/resolve-uri": ["@jridgewell/[email protected]", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
+
+ "@jridgewell/set-array": ["@jridgewell/[email protected]", "", {}, "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A=="],
+
+ "@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
+
+ "@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@rollup/plugin-inject": ["@rollup/[email protected]", "", { "dependencies": { "@rollup/pluginutils": "^5.0.1", "estree-walker": "^2.0.2", "magic-string": "^0.30.3" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg=="],
+
+ "@rollup/plugin-virtual": ["@rollup/[email protected]", "", { "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" } }, "sha512-10monEYsBp3scM4/ND4LNH5Rxvh3e/cVeL3jWTgZ2SrQ+BmUoQcopVQvnaMcOnykb1VkxUFuDAN+0FnpTFRy2A=="],
+
+ "@rollup/pluginutils": ["@rollup/[email protected]", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q=="],
+
+ "@rollup/rollup-android-arm-eabi": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-qZdlImWXur0CFakn2BJ2znJOdqYZKiedEPEVNTBrpfPjc/YuTGcaYZcdmNFTkUj3DU0ZM/AElcM8Ybww3xVLzA=="],
+
+ "@rollup/rollup-android-arm64": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-4KW7P53h6HtJf5Y608T1ISKvNIYLWRKMvfnG0c44M6In4DQVU58HZFEVhWINDZKp7FZps98G3gxwC1sb0wXUUg=="],
+
+ "@rollup/rollup-darwin-arm64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-0CY3/K54slrzLDjOA7TOjN1NuLKERBgk9nY5V34mhmuu673YNb+7ghaDUs6N0ujXR7fz5XaS5Aa6d2TNxZd0OQ=="],
+
+ "@rollup/rollup-darwin-x64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-eOojSEAi/acnsJVYRxnMkPFqcxSMFfrw7r2iD9Q32SGkb/Q9FpUY1UlAu1DH9T7j++gZ0lHjnm4OyH2vCI7l7Q=="],
+
+ "@rollup/rollup-freebsd-arm64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-2lzjQPJbN5UnHm7bHIUKFMulGTQwdvOkouJDpPysJS+QFBGDJqcfh+CxxtG23Ik/9tEvnebQiylYoazFMAgrYw=="],
+
+ "@rollup/rollup-freebsd-x64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-SLl0hi2Ah2H7xQYd6Qaiu01kFPzQ+hqvdYSoOtHYg/zCIFs6t8sV95kaoqjzjFwuYQLtOI0RZre/Ke0nPaQV+g=="],
+
+ "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg=="],
+
+ "@rollup/rollup-linux-arm-musleabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA=="],
+
+ "@rollup/rollup-linux-arm64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw=="],
+
+ "@rollup/rollup-linux-arm64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A=="],
+
+ "@rollup/rollup-linux-loongarch64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg=="],
+
+ "@rollup/rollup-linux-powerpc64le-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA=="],
+
+ "@rollup/rollup-linux-riscv64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg=="],
+
+ "@rollup/rollup-linux-s390x-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ=="],
+
+ "@rollup/rollup-linux-x64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A=="],
+
+ "@rollup/rollup-linux-x64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA=="],
+
+ "@rollup/rollup-win32-arm64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q=="],
+
+ "@rollup/rollup-win32-ia32-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-KB48mPtaoHy1AwDNkAJfHXvHp24H0ryZog28spEs0V48l3H1fr4i37tiyHsgKZJnCmvxsbATdZGBpbmxTE3a9w=="],
+
+ "@rollup/rollup-win32-x64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-AyleYRPU7+rgkMWbEh71fQlrzRfeP6SyMnRf9XX4fCdDPAJumdSBqYEcWPMzVQ4ScAl7E4oFfK0GUVn77xSwbw=="],
+
+ "@swc/core": ["@swc/[email protected]", "", { "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.19" }, "optionalDependencies": { "@swc/core-darwin-arm64": "1.11.7", "@swc/core-darwin-x64": "1.11.7", "@swc/core-linux-arm-gnueabihf": "1.11.7", "@swc/core-linux-arm64-gnu": "1.11.7", "@swc/core-linux-arm64-musl": "1.11.7", "@swc/core-linux-x64-gnu": "1.11.7", "@swc/core-linux-x64-musl": "1.11.7", "@swc/core-win32-arm64-msvc": "1.11.7", "@swc/core-win32-ia32-msvc": "1.11.7", "@swc/core-win32-x64-msvc": "1.11.7" }, "peerDependencies": { "@swc/helpers": "*" }, "optionalPeers": ["@swc/helpers"] }, "sha512-ICuzjyfz8Hh3U16Mb21uCRJeJd/lUgV999GjgvPhJSISM1L8GDSB5/AMNcwuGs7gFywTKI4vAeeXWyCETUXHAg=="],
+
+ "@swc/core-darwin-arm64": ["@swc/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-3+LhCP2H50CLI6yv/lhOtoZ5B/hi7Q/23dye1KhbSDeDprLTm/KfLJh/iQqwaHUponf5m8C2U0y6DD+HGLz8Yw=="],
+
+ "@swc/core-darwin-x64": ["@swc/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-1diWpJqwX1XmOghf9ENFaeRaTtqLiqlZIW56RfOqmeZ7tPp3qS7VygWb9akptBsO5pEA5ZwNgSerD6AJlQcjAw=="],
+
+ "@swc/core-linux-arm-gnueabihf": ["@swc/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-MV8+hLREf0NN23NuSKemsjFaWjl/HnqdOkE7uhXTnHzg8WTwp6ddVtU5Yriv15+d/ktfLWPVAOhLHQ4gzaoa8A=="],
+
+ "@swc/core-linux-arm64-gnu": ["@swc/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-5GNs8ZjHQy/UTSnzzn+gm1RCUpCYo43lsxYOl8mpcnZSfxkNFVpjfylBv0QuJ5qhdfZ2iU55+v4iJCwCMtw0nA=="],
+
+ "@swc/core-linux-arm64-musl": ["@swc/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-cTydaYBwDbVV5CspwVcCp9IevYWpGD1cF5B5KlBdjmBzxxeWyTAJRtKzn8w5/UJe/MfdAptarpqMPIs2f33YEQ=="],
+
+ "@swc/core-linux-x64-gnu": ["@swc/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-YAX2KfYPlbDsnZiVMI4ZwotF3VeURUrzD+emJgFf1g26F4eEmslldgnDrKybW7V+bObsH22cDqoy6jmQZgpuPQ=="],
+
+ "@swc/core-linux-x64-musl": ["@swc/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-mYT6FTDZyYx5pailc8xt6ClS2yjKmP8jNHxA9Ce3K21n5qkKilI5M2N7NShwXkd3Ksw3F29wKrg+wvEMXTRY/A=="],
+
+ "@swc/core-win32-arm64-msvc": ["@swc/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-uLDQEcv0BHcepypstyxKkNsW6KfLyI5jVxTbcxka+B2UnMcFpvoR87nGt2JYW0grO2SNZPoFz+UnoKL9c6JxpA=="],
+
+ "@swc/core-win32-ia32-msvc": ["@swc/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-wiq5G3fRizdxAJVFcon7zpyfbfrb+YShuTy+TqJ4Nf5PC0ueMOXmsmeuyQGApn6dVWtGCyymYQYt77wHeQajdA=="],
+
+ "@swc/core-win32-x64-msvc": ["@swc/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-/zQdqY4fHkSORxEJ2cKtRBOwglvf/8gs6Tl4Q6VMx2zFtFpIOwFQstfY5u8wBNN2Z+PkAzyUCPoi8/cQFK8HLQ=="],
+
+ "@swc/counter": ["@swc/[email protected]", "", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="],
+
+ "@swc/types": ["@swc/[email protected]", "", { "dependencies": { "@swc/counter": "^0.1.3" } }, "sha512-WkAZaAfj44kh/UFdAQcrMP1I0nwRqpt27u+08LMBYMqmQfwwMofYoMh/48NGkMMRfC4ynpfwRbJuu8ErfNloeA=="],
+
+ "@tailwindcss/node": ["@tailwindcss/[email protected]", "", { "dependencies": { "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", "tailwindcss": "4.0.12" } }, "sha512-a6J11K1Ztdln9OrGfoM75/hChYPcHYGNYimqciMrvKXRmmPaS8XZTHhdvb5a3glz4Kd4ZxE1MnuFE2c0fGGmtg=="],
+
+ "@tailwindcss/oxide": ["@tailwindcss/[email protected]", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.0.12", "@tailwindcss/oxide-darwin-arm64": "4.0.12", "@tailwindcss/oxide-darwin-x64": "4.0.12", "@tailwindcss/oxide-freebsd-x64": "4.0.12", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.12", "@tailwindcss/oxide-linux-arm64-gnu": "4.0.12", "@tailwindcss/oxide-linux-arm64-musl": "4.0.12", "@tailwindcss/oxide-linux-x64-gnu": "4.0.12", "@tailwindcss/oxide-linux-x64-musl": "4.0.12", "@tailwindcss/oxide-win32-arm64-msvc": "4.0.12", "@tailwindcss/oxide-win32-x64-msvc": "4.0.12" } }, "sha512-DWb+myvJB9xJwelwT9GHaMc1qJj6MDXRDR0CS+T8IdkejAtu8ctJAgV4r1drQJLPeS7mNwq2UHW2GWrudTf63A=="],
+
+ "@tailwindcss/oxide-android-arm64": ["@tailwindcss/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-dAXCaemu3mHLXcA5GwGlQynX8n7tTdvn5i1zAxRvZ5iC9fWLl5bGnjZnzrQqT7ttxCvRwdVf3IHUnMVdDBO/kQ=="],
+
+ "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-vPNI+TpJQ7sizselDXIJdYkx9Cu6JBdtmRWujw9pVIxW8uz3O2PjgGGzL/7A0sXI8XDjSyRChrUnEW9rQygmJQ=="],
+
+ "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-RL/9jM41Fdq4Efr35C5wgLx98BirnrfwuD+zgMFK6Ir68HeOSqBhW9jsEeC7Y/JcGyPd3MEoJVIU4fAb7YLg7A=="],
+
+ "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-7WzWiax+LguJcMEimY0Q4sBLlFXu1tYxVka3+G2M9KmU/3m84J3jAIV4KZWnockbHsbb2XgrEjtlJKVwHQCoRA=="],
+
+ "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-X9LRC7jjE1QlfIaBbXjY0PGeQP87lz5mEfLSVs2J1yRc9PSg1tEPS9NBqY4BU9v5toZgJgzKeaNltORyTs22TQ=="],
+
+ "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-i24IFNq2402zfDdoWKypXz0ZNS2G4NKaA82tgBlE2OhHIE+4mg2JDb5wVfyP6R+MCm5grgXvurcIcKWvo44QiQ=="],
+
+ "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-LmOdshJBfAGIBG0DdBWhI0n5LTMurnGGJCHcsm9F//ISfsHtCnnYIKgYQui5oOz1SUCkqsMGfkAzWyNKZqbGNw=="],
+
+ "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-OSK667qZRH30ep8RiHbZDQfqkXjnzKxdn0oRwWzgCO8CoTxV+MvIkd0BWdQbYtYuM1wrakARV/Hwp0eA/qzdbw=="],
+
+ "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-uylhWq6OWQ8krV8Jk+v0H/3AZKJW6xYMgNMyNnUbbYXWi7hIVdxRKNUB5UvrlC3RxtgsK5EAV2i1CWTRsNcAnA=="],
+
+ "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-XDLnhMoXZEEOir1LK43/gHHwK84V1GlV8+pAncUAIN2wloeD+nNciI9WRIY/BeFTqES22DhTIGoilSO39xDb2g=="],
+
+ "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-I/BbjCLpKDQucvtn6rFuYLst1nfFwSMYyPzkx/095RE+tuzk5+fwXuzQh7T3fIBTcbn82qH/sFka7yPGA50tLw=="],
+
+ "@tailwindcss/vite": ["@tailwindcss/[email protected]", "", { "dependencies": { "@tailwindcss/node": "4.0.12", "@tailwindcss/oxide": "4.0.12", "lightningcss": "^1.29.1", "tailwindcss": "4.0.12" }, "peerDependencies": { "vite": "^5.2.0 || ^6" } }, "sha512-JM3gp601UJiryIZ9R2bSqalzcOy15RCybQ1Q+BJqDEwVyo4LkWKeqQAcrpHapWXY31OJFTuOUVBFDWMhzHm2Bg=="],
+
+ "@types/babel__core": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
+
+ "@types/babel__generator": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw=="],
+
+ "@types/babel__template": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],
+
+ "@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.20.7" } }, "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg=="],
+
+ "@types/estree": ["@types/[email protected]", "", {}, "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw=="],
+
+ "asn1.js": ["[email protected]", "", { "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw=="],
+
+ "assert": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.2", "is-nan": "^1.3.2", "object-is": "^1.1.5", "object.assign": "^4.1.4", "util": "^0.12.5" } }, "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw=="],
+
+ "available-typed-arrays": ["[email protected]", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
+
+ "babel-plugin-jsx-dom-expressions": ["[email protected]", "", { "dependencies": { "@babel/helper-module-imports": "7.18.6", "@babel/plugin-syntax-jsx": "^7.18.6", "@babel/types": "^7.20.7", "html-entities": "2.3.3", "parse5": "^7.1.2", "validate-html-nesting": "^1.2.1" }, "peerDependencies": { "@babel/core": "^7.20.12" } }, "sha512-8GzVmFla7jaTNWW8W+lTMl9YGva4/06CtwJjySnkYtt8G1v9weCzc2SuF1DfrudcCNb2Doetc1FRg33swBYZCA=="],
+
+ "babel-preset-solid": ["[email protected]", "", { "dependencies": { "babel-plugin-jsx-dom-expressions": "^0.39.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-85I3osODJ1LvZbv8wFozROV1vXq32BubqHXAGu73A//TRs3NLI1OFP83AQBUTSQHwgZQmARjHlJciym3we+V+w=="],
+
+ "base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
+
+ "bn.js": ["[email protected]", "", {}, "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw=="],
+
+ "brorand": ["[email protected]", "", {}, "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w=="],
+
+ "browser-resolve": ["[email protected]", "", { "dependencies": { "resolve": "^1.17.0" } }, "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ=="],
+
+ "browserify-aes": ["[email protected]", "", { "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", "create-hash": "^1.1.0", "evp_bytestokey": "^1.0.3", "inherits": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA=="],
+
+ "browserify-cipher": ["[email protected]", "", { "dependencies": { "browserify-aes": "^1.0.4", "browserify-des": "^1.0.0", "evp_bytestokey": "^1.0.0" } }, "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w=="],
+
+ "browserify-des": ["[email protected]", "", { "dependencies": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A=="],
+
+ "browserify-rsa": ["[email protected]", "", { "dependencies": { "bn.js": "^5.2.1", "randombytes": "^2.1.0", "safe-buffer": "^5.2.1" } }, "sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ=="],
+
+ "browserify-sign": ["[email protected]", "", { "dependencies": { "bn.js": "^5.2.2", "browserify-rsa": "^4.1.1", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "elliptic": "^6.6.1", "inherits": "^2.0.4", "parse-asn1": "^5.1.9", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1" } }, "sha512-C2AUdAJg6rlM2W5QMp2Q4KGQMVBwR1lIimTsUnutJ8bMpW5B52pGpR2gEnNBNwijumDo5FojQ0L9JrXA8m4YEw=="],
+
+ "browserify-zlib": ["[email protected]", "", { "dependencies": { "pako": "~1.0.5" } }, "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA=="],
+
+ "browserslist": ["[email protected]", "", { "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": "cli.js" }, "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A=="],
+
+ "buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
+
+ "buffer-xor": ["[email protected]", "", {}, "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ=="],
+
+ "builtin-status-codes": ["[email protected]", "", {}, "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ=="],
+
+ "call-bind": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
+
+ "call-bind-apply-helpers": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
+
+ "call-bound": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
+
+ "caniuse-lite": ["[email protected]", "", {}, "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA=="],
+
+ "cipher-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1", "to-buffer": "^1.2.2" } }, "sha512-Mz9QMT5fJe7bKI7MH31UilT5cEK5EHHRCccw/YRFsRY47AuNgaV6HY3rscp0/I4Q+tTW/5zoqpSeRRI54TkDWA=="],
+
+ "console-browserify": ["[email protected]", "", {}, "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA=="],
+
+ "constants-browserify": ["[email protected]", "", {}, "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ=="],
+
+ "convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
+
+ "core-util-is": ["[email protected]", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="],
+
+ "create-ecdh": ["[email protected]", "", { "dependencies": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" } }, "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A=="],
+
+ "create-hash": ["[email protected]", "", { "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", "md5.js": "^1.3.4", "ripemd160": "^2.0.1", "sha.js": "^2.4.0" } }, "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg=="],
+
+ "create-hmac": ["[email protected]", "", { "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", "inherits": "^2.0.1", "ripemd160": "^2.0.0", "safe-buffer": "^5.0.1", "sha.js": "^2.4.8" } }, "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg=="],
+
+ "create-require": ["[email protected]", "", {}, "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="],
+
+ "crypto-browserify": ["[email protected]", "", { "dependencies": { "browserify-cipher": "^1.0.1", "browserify-sign": "^4.2.3", "create-ecdh": "^4.0.4", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "diffie-hellman": "^5.0.3", "hash-base": "~3.0.4", "inherits": "^2.0.4", "pbkdf2": "^3.1.2", "public-encrypt": "^4.0.3", "randombytes": "^2.1.0", "randomfill": "^1.0.4" } }, "sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ=="],
+
+ "csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
+
+ "debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
+
+ "define-data-property": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
+
+ "define-properties": ["[email protected]", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="],
+
+ "des.js": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg=="],
+
+ "detect-libc": ["[email protected]", "", {}, "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw=="],
+
+ "diffie-hellman": ["[email protected]", "", { "dependencies": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" } }, "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg=="],
+
+ "domain-browser": ["[email protected]", "", {}, "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw=="],
+
+ "dunder-proto": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
+
+ "electron-to-chromium": ["[email protected]", "", {}, "sha512-wjT2O4hX+wdWPJ76gWSkMhcHAV2PTMX+QetUCPYEdCIe+cxmgzzSSiGRCKW8nuh4mwKZlpv0xvoW7OF2X+wmHg=="],
+
+ "elliptic": ["[email protected]", "", { "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.1", "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g=="],
+
+ "enhanced-resolve": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg=="],
+
+ "entities": ["[email protected]", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
+
+ "es-define-property": ["[email protected]", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
+
+ "es-errors": ["[email protected]", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
+
+ "es-object-atoms": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
+
+ "esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.0", "@esbuild/android-arm": "0.25.0", "@esbuild/android-arm64": "0.25.0", "@esbuild/android-x64": "0.25.0", "@esbuild/darwin-arm64": "0.25.0", "@esbuild/darwin-x64": "0.25.0", "@esbuild/freebsd-arm64": "0.25.0", "@esbuild/freebsd-x64": "0.25.0", "@esbuild/linux-arm": "0.25.0", "@esbuild/linux-arm64": "0.25.0", "@esbuild/linux-ia32": "0.25.0", "@esbuild/linux-loong64": "0.25.0", "@esbuild/linux-mips64el": "0.25.0", "@esbuild/linux-ppc64": "0.25.0", "@esbuild/linux-riscv64": "0.25.0", "@esbuild/linux-s390x": "0.25.0", "@esbuild/linux-x64": "0.25.0", "@esbuild/netbsd-arm64": "0.25.0", "@esbuild/netbsd-x64": "0.25.0", "@esbuild/openbsd-arm64": "0.25.0", "@esbuild/openbsd-x64": "0.25.0", "@esbuild/sunos-x64": "0.25.0", "@esbuild/win32-arm64": "0.25.0", "@esbuild/win32-ia32": "0.25.0", "@esbuild/win32-x64": "0.25.0" }, "bin": "bin/esbuild" }, "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw=="],
+
+ "escalade": ["[email protected]", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
+
+ "estree-walker": ["[email protected]", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
+
+ "events": ["[email protected]", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="],
+
+ "evp_bytestokey": ["[email protected]", "", { "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" } }, "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA=="],
+
+ "fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
+
+ "find-up": ["[email protected]", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
+
+ "for-each": ["[email protected]", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
+
+ "fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
+
+ "function-bind": ["[email protected]", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
+
+ "generator-function": ["[email protected]", "", {}, "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g=="],
+
+ "gensync": ["[email protected]", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
+
+ "get-intrinsic": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
+
+ "get-proto": ["[email protected]", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
+
+ "globals": ["[email protected]", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
+
+ "gopd": ["[email protected]", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
+
+ "graceful-fs": ["[email protected]", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
+
+ "has-property-descriptors": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
+
+ "has-symbols": ["[email protected]", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
+
+ "has-tostringtag": ["[email protected]", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
+
+ "hash-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1" } }, "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg=="],
+
+ "hash.js": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA=="],
+
+ "hasown": ["[email protected]", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
+
+ "hmac-drbg": ["[email protected]", "", { "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg=="],
+
+ "html-entities": ["[email protected]", "", {}, "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA=="],
+
+ "https-browserify": ["[email protected]", "", {}, "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg=="],
+
+ "ieee754": ["[email protected]", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
+
+ "inherits": ["[email protected]", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
+
+ "is-arguments": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA=="],
+
+ "is-callable": ["[email protected]", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="],
+
+ "is-core-module": ["[email protected]", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
+
+ "is-generator-function": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.4", "generator-function": "^2.0.0", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA=="],
+
+ "is-nan": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" } }, "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w=="],
+
+ "is-regex": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="],
+
+ "is-typed-array": ["[email protected]", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="],
+
+ "is-what": ["[email protected]", "", {}, "sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A=="],
+
+ "isarray": ["[email protected]", "", {}, "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="],
+
+ "isomorphic-timers-promises": ["[email protected]", "", {}, "sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ=="],
+
+ "jiti": ["[email protected]", "", { "bin": "lib/jiti-cli.mjs" }, "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A=="],
+
+ "jose": ["[email protected]", "", {}, "sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ=="],
+
+ "js-tokens": ["[email protected]", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
+
+ "jsesc": ["[email protected]", "", { "bin": "bin/jsesc" }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
+
+ "json5": ["[email protected]", "", { "bin": "lib/cli.js" }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
+
+ "lightningcss": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-darwin-arm64": "1.29.2", "lightningcss-darwin-x64": "1.29.2", "lightningcss-freebsd-x64": "1.29.2", "lightningcss-linux-arm-gnueabihf": "1.29.2", "lightningcss-linux-arm64-gnu": "1.29.2", "lightningcss-linux-arm64-musl": "1.29.2", "lightningcss-linux-x64-gnu": "1.29.2", "lightningcss-linux-x64-musl": "1.29.2", "lightningcss-win32-arm64-msvc": "1.29.2", "lightningcss-win32-x64-msvc": "1.29.2" } }, "sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA=="],
+
+ "lightningcss-darwin-arm64": ["[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA=="],
+
+ "lightningcss-darwin-x64": ["[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-j5qYxamyQw4kDXX5hnnCKMf3mLlHvG44f24Qyi2965/Ycz829MYqjrVg2H8BidybHBp9kom4D7DR5VqCKDXS0w=="],
+
+ "lightningcss-freebsd-x64": ["[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-wDk7M2tM78Ii8ek9YjnY8MjV5f5JN2qNVO+/0BAGZRvXKtQrBC4/cn4ssQIpKIPP44YXw6gFdpUF+Ps+RGsCwg=="],
+
+ "lightningcss-linux-arm-gnueabihf": ["[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-IRUrOrAF2Z+KExdExe3Rz7NSTuuJ2HvCGlMKoquK5pjvo2JY4Rybr+NrKnq0U0hZnx5AnGsuFHjGnNT14w26sg=="],
+
+ "lightningcss-linux-arm64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-KKCpOlmhdjvUTX/mBuaKemp0oeDIBBLFiU5Fnqxh1/DZ4JPZi4evEH7TKoSBFOSOV3J7iEmmBaw/8dpiUvRKlQ=="],
+
+ "lightningcss-linux-arm64-musl": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-Q64eM1bPlOOUgxFmoPUefqzY1yV3ctFPE6d/Vt7WzLW4rKTv7MyYNky+FWxRpLkNASTnKQUaiMJ87zNODIrrKQ=="],
+
+ "lightningcss-linux-x64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-0v6idDCPG6epLXtBH/RPkHvYx74CVziHo6TMYga8O2EiQApnUPZsbR9nFNrg2cgBzk1AYqEd95TlrsL7nYABQg=="],
+
+ "lightningcss-linux-x64-musl": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-rMpz2yawkgGT8RULc5S4WiZopVMOFWjiItBT7aSfDX4NQav6M44rhn5hjtkKzB+wMTRlLLqxkeYEtQ3dd9696w=="],
+
+ "lightningcss-win32-arm64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-nL7zRW6evGQqYVu/bKGK+zShyz8OVzsCotFgc7judbt6wnB2KbiKKJwBE4SGoDBQ1O94RjW4asrCjQL4i8Fhbw=="],
+
+ "lightningcss-win32-x64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-EdIUW3B2vLuHmv7urfzMI/h2fmlnOQBk1xlsDxkN1tCWKjNFjfLhGxYk8C8mzpSfr+A6jFFIi8fU6LbQGsRWjA=="],
+
+ "locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
+
+ "loro-crdt": ["[email protected]", "", {}, "sha512-9YvKzoNE1CpDR/DNSUMolaSkhXdHnChP8uVkfORE3iREKOILUc5OZNipMMMhsnHQesL8HxM8D+2Z3vdXlV48Ew=="],
+
+ "lru-cache": ["[email protected]", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
+
+ "magic-string": ["[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
+
+ "math-intrinsics": ["[email protected]", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
+
+ "md5.js": ["[email protected]", "", { "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg=="],
+
+ "merge-anything": ["[email protected]", "", { "dependencies": { "is-what": "^4.1.8" } }, "sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ=="],
+
+ "miller-rabin": ["[email protected]", "", { "dependencies": { "bn.js": "^4.0.0", "brorand": "^1.0.1" }, "bin": { "miller-rabin": "bin/miller-rabin" } }, "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA=="],
+
+ "minimalistic-assert": ["[email protected]", "", {}, "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="],
+
+ "minimalistic-crypto-utils": ["[email protected]", "", {}, "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg=="],
+
+ "ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
+
+ "nanoid": ["[email protected]", "", { "bin": "bin/nanoid.cjs" }, "sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg=="],
+
+ "node-releases": ["[email protected]", "", {}, "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="],
+
+ "node-stdlib-browser": ["[email protected]", "", { "dependencies": { "assert": "^2.0.0", "browser-resolve": "^2.0.0", "browserify-zlib": "^0.2.0", "buffer": "^5.7.1", "console-browserify": "^1.1.0", "constants-browserify": "^1.0.0", "create-require": "^1.1.1", "crypto-browserify": "^3.12.1", "domain-browser": "4.22.0", "events": "^3.0.0", "https-browserify": "^1.0.0", "isomorphic-timers-promises": "^1.0.1", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", "pkg-dir": "^5.0.0", "process": "^0.11.10", "punycode": "^1.4.1", "querystring-es3": "^0.2.1", "readable-stream": "^3.6.0", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "string_decoder": "^1.0.0", "timers-browserify": "^2.0.4", "tty-browserify": "0.0.1", "url": "^0.11.4", "util": "^0.12.4", "vm-browserify": "^1.0.1" } }, "sha512-X75ZN8DCLftGM5iKwoYLA3rjnrAEs97MkzvSd4q2746Tgpg8b8XWiBGiBG4ZpgcAqBgtgPHTiAc8ZMCvZuikDw=="],
+
+ "object-inspect": ["[email protected]", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
+
+ "object-is": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" } }, "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q=="],
+
+ "object-keys": ["[email protected]", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],
+
+ "object.assign": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],
+
+ "os-browserify": ["[email protected]", "", {}, "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A=="],
+
+ "p-limit": ["[email protected]", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
+
+ "p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],
+
+ "pako": ["[email protected]", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
+
+ "parse-asn1": ["[email protected]", "", { "dependencies": { "asn1.js": "^4.10.1", "browserify-aes": "^1.2.0", "evp_bytestokey": "^1.0.3", "pbkdf2": "^3.1.5", "safe-buffer": "^5.2.1" } }, "sha512-fIYNuZ/HastSb80baGOuPRo1O9cf4baWw5WsAp7dBuUzeTD/BoaG8sVTdlPFksBE2lF21dN+A1AnrpIjSWqHHg=="],
+
+ "parse5": ["[email protected]", "", { "dependencies": { "entities": "^4.5.0" } }, "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ=="],
+
+ "path-browserify": ["[email protected]", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
+
+ "path-exists": ["[email protected]", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
+
+ "path-parse": ["[email protected]", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
+
+ "pbkdf2": ["[email protected]", "", { "dependencies": { "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "ripemd160": "^2.0.3", "safe-buffer": "^5.2.1", "sha.js": "^2.4.12", "to-buffer": "^1.2.1" } }, "sha512-Q3CG/cYvCO1ye4QKkuH7EXxs3VC/rI1/trd+qX2+PolbaKG0H+bgcZzrTt96mMyRtejk+JMCiLUn3y29W8qmFQ=="],
+
+ "picocolors": ["[email protected]", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
+
+ "picomatch": ["[email protected]", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
+
+ "pkg-dir": ["[email protected]", "", { "dependencies": { "find-up": "^5.0.0" } }, "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA=="],
+
+ "possible-typed-array-names": ["[email protected]", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="],
+
+ "postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A=="],
+
+ "process": ["[email protected]", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="],
+
+ "process-nextick-args": ["[email protected]", "", {}, "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="],
+
+ "public-encrypt": ["[email protected]", "", { "dependencies": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", "create-hash": "^1.1.0", "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q=="],
+
+ "punycode": ["[email protected]", "", {}, "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ=="],
+
+ "qs": ["[email protected]", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="],
+
+ "querystring-es3": ["[email protected]", "", {}, "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA=="],
+
+ "randombytes": ["[email protected]", "", { "dependencies": { "safe-buffer": "^5.1.0" } }, "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ=="],
+
+ "randomfill": ["[email protected]", "", { "dependencies": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" } }, "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw=="],
+
+ "readable-stream": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
+
+ "resolve": ["[email protected]", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="],
+
+ "ripemd160": ["[email protected]", "", { "dependencies": { "hash-base": "^3.1.2", "inherits": "^2.0.4" } }, "sha512-5Di9UC0+8h1L6ZD2d7awM7E/T4uA1fJRlx6zk/NvdCCVEoAnFqvHmCuNeIKoCeIixBX/q8uM+6ycDvF8woqosA=="],
+
+ "rollup": ["[email protected]", "", { "dependencies": { "@types/estree": "1.0.6" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.34.9", "@rollup/rollup-android-arm64": "4.34.9", "@rollup/rollup-darwin-arm64": "4.34.9", "@rollup/rollup-darwin-x64": "4.34.9", "@rollup/rollup-freebsd-arm64": "4.34.9", "@rollup/rollup-freebsd-x64": "4.34.9", "@rollup/rollup-linux-arm-gnueabihf": "4.34.9", "@rollup/rollup-linux-arm-musleabihf": "4.34.9", "@rollup/rollup-linux-arm64-gnu": "4.34.9", "@rollup/rollup-linux-arm64-musl": "4.34.9", "@rollup/rollup-linux-loongarch64-gnu": "4.34.9", "@rollup/rollup-linux-powerpc64le-gnu": "4.34.9", "@rollup/rollup-linux-riscv64-gnu": "4.34.9", "@rollup/rollup-linux-s390x-gnu": "4.34.9", "@rollup/rollup-linux-x64-gnu": "4.34.9", "@rollup/rollup-linux-x64-musl": "4.34.9", "@rollup/rollup-win32-arm64-msvc": "4.34.9", "@rollup/rollup-win32-ia32-msvc": "4.34.9", "@rollup/rollup-win32-x64-msvc": "4.34.9", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-nF5XYqWWp9hx/LrpC8sZvvvmq0TeTjQgaZHYmAgwysT9nh8sWnZhBnM8ZyVbbJFIQBLwHDNoMqsBZBbUo4U8sQ=="],
+
+ "safe-buffer": ["[email protected]", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "safe-regex-test": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="],
+
+ "semver": ["[email protected]", "", { "bin": "bin/semver.js" }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "seroval": ["[email protected]", "", {}, "sha512-yBxFFs3zmkvKNmR0pFSU//rIsYjuX418TnlDmc2weaq5XFDqDIV/NOMPBoLrbxjLH42p4UzRuXHryXh9dYcKcw=="],
+
+ "seroval-plugins": ["[email protected]", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-H5vs53+39+x4Udwp4J5rNZfgFuA+Lt+uU+09w1gYBVWomtAl98B+E9w7yC05Xc81/HgLvJdlyqJbU0fJCKCmdw=="],
+
+ "set-function-length": ["[email protected]", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
+
+ "setimmediate": ["[email protected]", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="],
+
+ "sha.js": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1", "to-buffer": "^1.2.0" }, "bin": { "sha.js": "bin.js" } }, "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w=="],
+
+ "side-channel": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
+
+ "side-channel-list": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
+
+ "side-channel-map": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
+
+ "side-channel-weakmap": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
+
+ "solid-js": ["[email protected]", "", { "dependencies": { "csstype": "^3.1.0", "seroval": "^1.1.0", "seroval-plugins": "^1.1.0" } }, "sha512-ogI3DaFcyn6UhYhrgcyRAMbu/buBJitYQASZz5WzfQVPP10RD2AbCoRZ517psnezrasyCbWzIxZ6kVqet768xw=="],
+
+ "solid-refresh": ["[email protected]", "", { "dependencies": { "@babel/generator": "^7.23.6", "@babel/helper-module-imports": "^7.22.15", "@babel/types": "^7.23.6" }, "peerDependencies": { "solid-js": "^1.3" } }, "sha512-F3aPsX6hVw9ttm5LYlth8Q15x6MlI/J3Dn+o3EQyRTtTxidepSTwAYdozt01/YA+7ObcciagGEyXIopGZzQtbA=="],
+
+ "source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
+
+ "stream-browserify": ["[email protected]", "", { "dependencies": { "inherits": "~2.0.4", "readable-stream": "^3.5.0" } }, "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA=="],
+
+ "stream-http": ["[email protected]", "", { "dependencies": { "builtin-status-codes": "^3.0.0", "inherits": "^2.0.4", "readable-stream": "^3.6.0", "xtend": "^4.0.2" } }, "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A=="],
+
+ "string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
+
+ "supports-preserve-symlinks-flag": ["[email protected]", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
+
+ "tailwindcss": ["[email protected]", "", {}, "sha512-bT0hJo91FtncsAMSsMzUkoo/iEU0Xs5xgFgVC9XmdM9bw5MhZuQFjPNl6wxAE0SiQF/YTZJa+PndGWYSDtuxAg=="],
+
+ "tapable": ["[email protected]", "", {}, "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="],
+
+ "timers-browserify": ["[email protected]", "", { "dependencies": { "setimmediate": "^1.0.4" } }, "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ=="],
+
+ "tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
+
+ "to-buffer": ["[email protected]", "", { "dependencies": { "isarray": "^2.0.5", "safe-buffer": "^5.2.1", "typed-array-buffer": "^1.0.3" } }, "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw=="],
+
+ "tty-browserify": ["[email protected]", "", {}, "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw=="],
+
+ "typed-array-buffer": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" } }, "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw=="],
+
+ "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
+
+ "update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": "cli.js" }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="],
+
+ "url": ["[email protected]", "", { "dependencies": { "punycode": "^1.4.1", "qs": "^6.12.3" } }, "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg=="],
+
+ "util": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA=="],
+
+ "util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
+
+ "uuid": ["[email protected]", "", { "bin": "dist/bin/uuid" }, "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="],
+
+ "validate-html-nesting": ["[email protected]", "", {}, "sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg=="],
+
+ "vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g=="],
+
+ "vite-plugin-node-polyfills": ["[email protected]", "", { "dependencies": { "@rollup/plugin-inject": "^5.0.5", "node-stdlib-browser": "^1.2.0" }, "peerDependencies": { "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-hR2YlaMqVo2f/0w6V9YgaeKsIy8z5gEsMFHX8MQlh8ATEAbfI4EWjE6qnCvkZ9lyaXKoJD2rAwL/up8/Rzsjkg=="],
+
+ "vite-plugin-solid": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.23.3", "@types/babel__core": "^7.20.4", "babel-preset-solid": "^1.8.4", "merge-anything": "^5.1.7", "solid-refresh": "^0.6.3", "vitefu": "^1.0.4" }, "peerDependencies": { "@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.*", "solid-js": "^1.7.2", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" }, "optionalPeers": ["@testing-library/jest-dom"] }, "sha512-Sl5CTqJTGyEeOsmdH6BOgalIZlwH3t4/y0RQuFLMGnvWMBvxb4+lq7x3BSiAw6etf0QexfNJW7HSOO/Qf7pigg=="],
+
+ "vite-plugin-top-level-await": ["[email protected]", "", { "dependencies": { "@rollup/plugin-virtual": "^3.0.2", "@swc/core": "^1.10.16", "uuid": "^10.0.0" }, "peerDependencies": { "vite": ">=2.8" } }, "sha512-r/DtuvHrSqUVk23XpG2cl8gjt1aATMG5cjExXL1BUTcSNab6CzkcPua9BPEc9fuTP5UpwClCxUe3+dNGL0yrgQ=="],
+
+ "vite-plugin-wasm": ["[email protected]", "", { "peerDependencies": { "vite": "^2 || ^3 || ^4 || ^5 || ^6" } }, "sha512-ja3nSo2UCkVeitltJGkS3pfQHAanHv/DqGatdI39ja6McgABlpsZ5hVgl6wuR8Qx5etY3T5qgDQhOWzc5RReZA=="],
+
+ "vitefu": ["[email protected]", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }, "sha512-+Rex1GlappUyNN6UfwbVZne/9cYC4+R2XDk9xkNXBKMw6HQagdX9PgZ8V2v1WUSK1wfBLp7qbI1+XSNIlB1xmA=="],
+
+ "vm-browserify": ["[email protected]", "", {}, "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ=="],
+
+ "which-typed-array": ["[email protected]", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw=="],
+
+ "xtend": ["[email protected]", "", {}, "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="],
+
+ "yallist": ["[email protected]", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
+
+ "yocto-queue": ["[email protected]", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
+
+ "@babel/code-frame/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/core/@babel/template": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/parser": "^7.26.9", "@babel/types": "^7.26.9" } }, "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA=="],
+
+ "@babel/core/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@babel/generator/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@babel/helper-module-imports/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@babel/helper-module-transforms/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/parser/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@babel/template/@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="],
+
+ "@babel/template/@babel/parser": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.5" }, "bin": "./bin/babel-parser.js" }, "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ=="],
+
+ "@babel/traverse/@babel/template": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/parser": "^7.26.9", "@babel/types": "^7.26.9" } }, "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA=="],
+
+ "@babel/traverse/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@jridgewell/gen-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
+
+ "@jridgewell/trace-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
+
+ "@types/babel__core/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@types/babel__generator/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@types/babel__template/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@types/babel__traverse/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "asn1.js/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "babel-plugin-jsx-dom-expressions/@babel/helper-module-imports": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.18.6" } }, "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA=="],
+
+ "babel-plugin-jsx-dom-expressions/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "browserify-sign/readable-stream": ["[email protected]", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
+
+ "create-ecdh/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "diffie-hellman/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "elliptic/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "md5.js/hash-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.4", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1", "to-buffer": "^1.2.1" } }, "sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg=="],
+
+ "miller-rabin/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "public-encrypt/bn.js": ["[email protected]", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
+
+ "ripemd160/hash-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.4", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1", "to-buffer": "^1.2.1" } }, "sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg=="],
+
+ "solid-refresh/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "to-buffer/isarray": ["[email protected]", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="],
+
+ "@babel/core/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/core/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/generator/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/generator/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/helper-module-imports/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/helper-module-imports/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/parser/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/parser/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/traverse/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/traverse/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@types/babel__core/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@types/babel__core/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@types/babel__generator/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@types/babel__generator/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@types/babel__template/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@types/babel__template/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@types/babel__traverse/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@types/babel__traverse/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "babel-plugin-jsx-dom-expressions/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "babel-plugin-jsx-dom-expressions/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "browserify-sign/readable-stream/safe-buffer": ["[email protected]", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
+
+ "browserify-sign/readable-stream/string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
+
+ "md5.js/hash-base/readable-stream": ["[email protected]", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
+
+ "ripemd160/hash-base/readable-stream": ["[email protected]", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
+
+ "solid-refresh/@babel/types/@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "solid-refresh/@babel/types/@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "md5.js/hash-base/readable-stream/safe-buffer": ["[email protected]", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
+
+ "md5.js/hash-base/readable-stream/string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
+
+ "ripemd160/hash-base/readable-stream/safe-buffer": ["[email protected]", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
+
+ "ripemd160/hash-base/readable-stream/string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
+ }
+}
diff --git a/rust/sync-service/qa-env/index.html b/rust/sync-service/qa-env/index.html
new file mode 100644
index 0000000000..48c59fc124
--- /dev/null
+++ b/rust/sync-service/qa-env/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#000000" />
+ <link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
+ <title>Solid App</title>
+ </head>
+ <body>
+ <noscript>You need to enable JavaScript to run this app.</noscript>
+ <div id="root"></div>
+
+ <script src="/src/index.tsx" type="module"></script>
+ </body>
+</html>
diff --git a/rust/sync-service/qa-env/package.json b/rust/sync-service/qa-env/package.json
new file mode 100644
index 0000000000..7ac217129a
--- /dev/null
+++ b/rust/sync-service/qa-env/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "vite-template-solid",
+ "version": "0.0.0",
+ "description": "",
+ "type": "module",
+ "packageManager": "bun@latest",
+ "scripts": {
+ "start": "vite",
+ "dev": "vite",
+ "build": "vite build",
+ "serve": "vite preview"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "typescript": "^5.7.2",
+ "vite": "^6.4.1",
+ "vite-plugin-solid": "^2.11.6"
+ },
+ "dependencies": {
+ "@babel/helpers": "^7.28.4",
+ "@tailwindcss/vite": "^4.0.12",
+ "jose": "^6.0.10",
+ "loro-crdt": "^1.4.6",
+ "solid-js": "^1.9.5",
+ "tailwindcss": "^4.0.12",
+ "vite-plugin-node-polyfills": "^0.23.0",
+ "vite-plugin-top-level-await": "^1.5.0",
+ "vite-plugin-wasm": "^3.4.1"
+ },
+ "resolutions": {
+ "@babel/helpers": ">=7.26.10"
+ }
+}
diff --git a/rust/sync-service/qa-env/src/App.tsx b/rust/sync-service/qa-env/src/App.tsx
new file mode 100644
index 0000000000..955077cf91
--- /dev/null
+++ b/rust/sync-service/qa-env/src/App.tsx
@@ -0,0 +1,59 @@
+import {
+ type Component,
+ createMemo,
+ createSignal,
+ For,
+ Match,
+ Switch,
+} from 'solid-js';
+import './index.css';
+import { Instance } from './Instance';
+
+export const [allContentMap, setAllContentMap] = createSignal<
+ Record<number, string>
+>();
+
+
+
+const App: Component = () => {
+
+ const allInSyncStatus = createMemo(() => {
+ const contentMap = allContentMap();
+ const values = Object.values(contentMap ?? {}).filter(value => typeof value === 'string' && value.length > 0);
+
+ if (values.length <= 1) {
+ return true;
+ }
+
+ const firstValue = values[0];
+ const allSame = values.slice(1).every(value => value === firstValue);
+
+ return allSame;
+ }, { defer: true });
+
+
+ return (
+ <div class="bg-neutral-900 min-w-screen min-h-screen text-white">
+ <h1>qa-env</h1>
+ <div class="flex flex-row flex-wrap gap-4 py-2">
+ <Switch>
+ <Match when={allInSyncStatus()}>
+ <div class="bg-green-500 text-white px-2">All in sync</div>
+ </Match>
+ <Match when={!allInSyncStatus()}>
+ <div class="bg-red-500 text-white px-2">Not all in sync</div>
+ </Match>
+ </Switch>
+ </div>
+ <div class="flex flex-row flex-wrap gap-4">
+ <For each={Array.from({ length: 200 })}>
+ {(_, index) => {
+ return <Instance id={index()} />;
+ }}
+ </For>
+ </div>
+ </div>
+ );
+};
+
+export default App;
diff --git a/rust/sync-service/qa-env/src/Instance.tsx b/rust/sync-service/qa-env/src/Instance.tsx
new file mode 100644
index 0000000000..c54904a2d2
--- /dev/null
+++ b/rust/sync-service/qa-env/src/Instance.tsx
@@ -0,0 +1,94 @@
+import { LoroDoc } from "loro-crdt";
+import { createEffect, createResource, createSignal } from "solid-js";
+import { setAllContentMap } from "./App";
+import { FromRemote, FromPeer } from "../../bebop/generated/schema";
+import * as jose from "jose";
+
+async function connectToWebSocket() {
+ const jwt = await new jose.SignJWT({
+ user_id: "test-user",
+ document_id: "test",
+ access_level: "owner",
+ exp: Math.floor(Date.now() / 1000) + 60,
+ })
+ .setProtectedHeader({ alg: "HS256" })
+ .setIssuedAt()
+ .setExpirationTime("10y")
+ .sign(new TextEncoder().encode("local"));
+
+ return new WebSocket(
+ `ws://localhost:8787/document/test/connect?token=${jwt}`,
+ );
+}
+
+export function Instance(props: { id: number }) {
+
+ const [webSocketResource] = createResource<WebSocket>(connectToWebSocket);
+
+ let textAreaRef!: HTMLTextAreaElement;
+ const loroDoc = new LoroDoc();
+ const [isInitialized, setIsInitialized] = createSignal(false);
+ const [content, setContent] = createSignal("");
+
+ createEffect(() => {
+ if (!isInitialized()) {
+ return;
+ }
+ setAllContentMap((prev) => ({
+ ...prev,
+ [props.id]: content(),
+ }));
+ });
+
+ createEffect(async () => {
+ webSocketResource()?.addEventListener("message", async (event) => {
+ const message = event.data as Blob;
+ const fromWebSocketMessage = FromRemote.decode(
+ new Uint8Array(await message.arrayBuffer()),
+ );
+
+ if (fromWebSocketMessage.isRemoteInitialSync()) {
+ loroDoc.import(fromWebSocketMessage.value.snapshot);
+ setIsInitialized(true);
+ } else if (fromWebSocketMessage.isRemoteUpdate()) {
+ loroDoc.import(fromWebSocketMessage.value.update);
+ }
+ });
+ });
+
+ createEffect(() => {
+ loroDoc.subscribeLocalUpdates((update) => {
+ const toWebSocketMessage = FromPeer.fromPeerUpdate({
+ update,
+ });
+ webSocketResource()?.send(toWebSocketMessage.encode());
+ });
+ loroDoc.subscribe((event) => {
+ const text = loroDoc.getText("content").toString();
+ setContent(text);
+ });
+ });
+
+ function handleChange(event: any) {
+ const newContent = event.target.value;
+
+ const content = loroDoc.getText("content");
+ content.update(newContent);
+ loroDoc.commit();
+ }
+
+ return (
+ <div
+ class={`border w-[100] h-[100px] ${!isInitialized() ? "border-red-500" : "border-green-500"}`}
+ >
+ <textarea
+ disabled={!isInitialized()}
+ ref={textAreaRef}
+ class="w-full h-full multiline text-xs"
+ placeholder="Instance Name"
+ value={content()}
+ onInput={handleChange}
+ />
+ </div>
+ );
+}
diff --git a/rust/sync-service/qa-env/src/index.css b/rust/sync-service/qa-env/src/index.css
new file mode 100644
index 0000000000..f1d8c73cdc
--- /dev/null
+++ b/rust/sync-service/qa-env/src/index.css
@@ -0,0 +1 @@
+@import "tailwindcss";
diff --git a/rust/sync-service/qa-env/src/index.tsx b/rust/sync-service/qa-env/src/index.tsx
new file mode 100644
index 0000000000..e79037a9bb
--- /dev/null
+++ b/rust/sync-service/qa-env/src/index.tsx
@@ -0,0 +1,14 @@
+/* @refresh reload */
+import { render } from 'solid-js/web';
+import './index.css';
+import App from './App';
+
+const root = document.getElementById('root');
+
+if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
+ throw new Error(
+ 'Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?'
+ );
+}
+
+render(() => <App />, root!);
diff --git a/rust/sync-service/qa-env/tsconfig.json b/rust/sync-service/qa-env/tsconfig.json
new file mode 100644
index 0000000000..249b2732a7
--- /dev/null
+++ b/rust/sync-service/qa-env/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "strict": true,
+ "target": "ESNext",
+ "module": "ESNext",
+ "moduleResolution": "node",
+ "allowSyntheticDefaultImports": true,
+ "esModuleInterop": true,
+ "jsx": "preserve",
+ "jsxImportSource": "solid-js",
+ "types": ["vite/client"],
+ "noEmit": true,
+ "isolatedModules": true
+ }
+}
diff --git a/rust/sync-service/qa-env/vite.config.ts b/rust/sync-service/qa-env/vite.config.ts
new file mode 100644
index 0000000000..f24e13bb9d
--- /dev/null
+++ b/rust/sync-service/qa-env/vite.config.ts
@@ -0,0 +1,22 @@
+import { defineConfig } from "vite";
+import tailwindcss from "@tailwindcss/vite";
+import solidPlugin from "vite-plugin-solid";
+import wasm from "vite-plugin-wasm";
+import topLevelAwait from "vite-plugin-top-level-await";
+import { nodePolyfills } from "vite-plugin-node-polyfills";
+
+export default defineConfig({
+ plugins: [
+ tailwindcss(),
+ wasm(),
+ topLevelAwait(),
+ solidPlugin(),
+ nodePolyfills({}),
+ ],
+ server: {
+ port: 3000,
+ },
+ build: {
+ target: "esnext",
+ },
+});
diff --git a/rust/sync-service/src/auth.rs b/rust/sync-service/src/auth.rs
new file mode 100644
index 0000000000..d9fb30b7ca
--- /dev/null
+++ b/rust/sync-service/src/auth.rs
@@ -0,0 +1,155 @@
+use jsonwebtoken::{Algorithm, DecodingKey, Validation, decode};
+use serde::{Deserialize, Serialize};
+use tracing::error;
+use worker::Error;
+
+use crate::{constants::header_names, error::ResultExt, secrets::Secrets};
+
+#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, PartialOrd, Ord)]
+#[serde(rename_all = "lowercase")]
+#[derive(Default)]
+pub enum AccessLevel {
+ /// User can view the document
+ #[default]
+ View = 0,
+ /// User can comment on the document
+ /// In this context, this is the same thing as [AccessLevel::View]
+ Comment = 1,
+ /// User can edit the document
+ Edit = 2,
+ /// User is the owner of the document
+ Owner = 3,
+ /// Internal communication
+ Admin = 4,
+}
+
+impl AccessLevel {
+ pub fn can_edit(&self) -> bool {
+ self >= &AccessLevel::Comment
+ }
+}
+
+#[derive(Deserialize, Debug)]
+pub struct AuthToken {
+ pub user_id: Option<String>,
+ document_id: String,
+ pub access_level: AccessLevel,
+}
+
+impl AuthToken {
+ pub fn has_permission(&self, al: &AccessLevel) -> bool {
+ if self.access_level < *al {
+ error!(
+ "Current permission level [{:?}] is not enough for [{:?}]",
+ self.access_level, al
+ );
+ return false;
+ }
+ true
+ }
+ pub fn has_document_id_access(&self, document_id: &str) -> bool {
+ if !(self.document_id == document_id || matches!(self.access_level, AccessLevel::Admin)) {
+ error!(
+ "Don't have permission for document: [{:?}]
+Auth'd document [{:?}]
+access level [{:?}]",
+ document_id, self.document_id, self.access_level
+ );
+ return false;
+ }
+ true
+ }
+}
+
+#[derive(Deserialize, Debug)]
+pub struct WebsocketQueryParams {
+ pub token: String,
+}
+
+pub enum TokenFrom {
+ Headers,
+ QueryParams,
+}
+
+pub fn decode_jwt(
+ req: &worker::Request,
+ env: &worker::Env,
+ token_from: TokenFrom,
+) -> worker::Result<AuthToken> {
+ let secrets = Secrets::from(env);
+ let token = match token_from {
+ TokenFrom::Headers => {
+ // NB: rewrite with if/let chain on edition 2024
+ let is_admin = match req
+ .headers()
+ .get(header_names::MACRO_INTERNAL_AUTH_KEY_HEADER_KEY)?
+ {
+ // sholud we warn when false?
+ Some(internal_key) => {
+ let res = internal_key == secrets.internal_api_secret;
+ if !res {
+ error!(
+ "provided header: {internal_key}
+did not match expected value: {}",
+ secrets.internal_api_secret
+ );
+ }
+ res
+ }
+ None => false,
+ };
+
+ if is_admin {
+ return Ok(AuthToken {
+ user_id: None,
+ document_id: "TODO should be option".to_string(),
+ access_level: AccessLevel::Admin,
+ });
+ }
+
+ match req.headers().get(header_names::AUTHORIZATION)? {
+ Some(header) => match header.strip_prefix("Bearer ") {
+ Some(token) => token.to_string(),
+ None => {
+ return Err(Error::from(
+ "'Authorization' heard malformed. No 'Bearer ' prefix",
+ ));
+ }
+ },
+ None => return Err(Error::from("Missing 'Authorization' header")),
+ }
+ }
+ TokenFrom::QueryParams => req.query::<WebsocketQueryParams>()?.token,
+ };
+
+ let validation = Validation::new(Algorithm::HS256);
+ let secret = secrets.document_permissions_secret;
+ let key = DecodingKey::from_secret(secret.to_string().as_bytes());
+
+ let claims = decode::<AuthToken>(&token, &key, &validation)
+ .context("failed to decode `AuthToken`")?
+ .claims;
+
+ Ok(claims)
+}
+
+#[cfg(test)]
+mod test {
+ use super::*;
+ #[test]
+ #[allow(clippy::nonminimal_bool, reason = "demonstrate ordering")]
+ fn orderable() {
+ let view = AccessLevel::View;
+ let comment = AccessLevel::Comment;
+ let edit = AccessLevel::Edit;
+ let owner = AccessLevel::Owner;
+
+ assert!(view < comment);
+ assert!(view <= view);
+ assert!(!(view < view));
+ assert!(edit <= owner);
+ assert!(view <= edit);
+ assert!(view < owner);
+ assert!(!(owner < view));
+ }
+}
diff --git a/rust/sync-service/src/cf_worker.rs b/rust/sync-service/src/cf_worker.rs
new file mode 100644
index 0000000000..e2137c89fa
--- /dev/null
+++ b/rust/sync-service/src/cf_worker.rs
@@ -0,0 +1,159 @@
+use bebop::{Record, SubRecord};
+use tracing::error;
+use wasm_bindgen::JsValue;
+use worker::{Env, Error, Headers, Method, Request, RequestInit, Response, Result, Stub};
+
+use crate::{
+ constants::header_names::{AUTHORIZATION, MACRO_INTERNAL_AUTH_KEY_HEADER_KEY},
+ durable_object::{CopyDocumentRequest, GetSnapshotRequest, response, status_codes},
+ error::ResultExt,
+ generated::schema::InitializeFromSnapshotRequest,
+ timeit_log,
+ timeout::{DEFAULT_TIMEOUT_MS, timeout},
+};
+use std::sync::LazyLock;
+
+const DURABLE_OBJECT_NAMESPACE: &str = "DOCUMENT_SYNC_SESSION";
+mod markers {
+ pub const ROOT: &str = "root";
+ pub const HEALTH: &str = "health";
+ pub const SCHEMA: &str = "schema";
+ pub const COPY: &str = "copy";
+ pub const REST: &str = "rest";
+}
+
+pub async fn router(env: Env, req: Request) -> Result<Response> {
+ let url = req.url()?;
+ let matched = ROUTER
+ .at(url.path())
+ .with_context(|| format!("MatchError on url [{url}]"))?;
+ match *matched.value {
+ markers::ROOT => Response::builder().ok("Hello Sync Service!"),
+ markers::HEALTH => Response::builder().ok("healthy"),
+ markers::SCHEMA => Response::builder().ok(include_str!("../bebop/schema.bop")),
+ needs_document_id => {
+ let document_id = matched.params.get("document_id").with_context(|| {
+ Error::from(format!(
+ "Failed to get path parameter [doocument_id] from url: [{}]",
+ url.as_ref()
+ ))
+ })?;
+ match needs_document_id {
+ markers::COPY => copy_handler(env, req, document_id).await,
+ markers::REST => pass_to_durable_object(&env, req, document_id).await,
+ _ => Ok(response(status_codes::NOT_FOUND)),
+ }
+ }
+ }
+}
+
+/// Get the original snapshot then initialize a new document with it.
+/// Copying interacts with multiple durable objects so we orchestrate it from the worker.
+pub async fn copy_handler(env: Env, mut req: Request, document_id: &str) -> Result<Response> {
+ fn mv_header(source: &Headers, dest: &Headers, header_name: &str) -> Result<()> {
+ if let Some(value) = source.get(header_name)? {
+ dest.set(header_name, &value)?;
+ }
+ Ok(())
+ }
+
+ /// build a request to send to a durable object
+ async fn do_helper(
+ env: &Env,
+ new_req_body: Vec<u8>,
+ new_req_path: &str,
+ og_req: &Request,
+ document_id: &str,
+ ) -> Result<Response> {
+ let mut ss_req = RequestInit::new();
+ ss_req.with_method(Method::Post);
+ ss_req.with_body(Some(JsValue::from(new_req_body)));
+
+ let headers = Headers::new();
+ mv_header(og_req.headers(), &headers, AUTHORIZATION)?;
+ mv_header(
+ og_req.headers(),
+ &headers,
+ MACRO_INTERNAL_AUTH_KEY_HEADER_KEY,
+ )?;
+ ss_req.with_headers(headers);
+
+ let mut url = og_req.url()?;
+ url.set_path(new_req_path);
+ let ss_req = Request::new_with_init(url.as_ref(), &ss_req)?;
+
+ pass_to_durable_object(env, ss_req, document_id).await
+ }
+
+ let body: CopyDocumentRequest = serde_json::from_slice(&req.bytes().await?)?;
+ let new_document_id = body.target_document_id;
+
+ let init_body = {
+ let new_req_body = serde_json::to_vec(&GetSnapshotRequest {
+ version_id: body.version_id,
+ })?;
+ let new_req_path = format!("/document/{}/snapshot", document_id);
+
+ let mut ss_res = do_helper(&env, new_req_body, &new_req_path, &req, document_id).await?;
+ if ss_res.status_code() != status_codes::OK {
+ return Ok(response(ss_res.status_code()));
+ }
+
+ let snapshot_body = InitializeFromSnapshotRequest {
+ snapshot: bebop::SliceWrapper::Raw(&ss_res.bytes().await?),
+ };
+ let mut buf = Vec::with_capacity(snapshot_body.serialized_size());
+ _ = snapshot_body
+ .serialize(&mut buf)
+ .context("Failed to serialize new snapshot")?;
+ buf
+ };
+
+ let initialize_path = format!("/document/{}/initialize", new_document_id);
+ let ss_res = do_helper(&env, init_body, &initialize_path, &req, &new_document_id).await?;
+ Ok(ss_res)
+}
+
+pub static ROUTER: LazyLock<matchit::Router<&str>> = LazyLock::new(|| {
+ let mut router = matchit::Router::new();
+ router
+ .insert("/", markers::ROOT)
+ .unwrap_context("Router.insert failed");
+ router
+ .insert("/health", markers::HEALTH)
+ .unwrap_context("Router.insert failed");
+ router
+ .insert("/schema", markers::SCHEMA)
+ .unwrap_context("Router.insert failed");
+ router
+ .insert("/document/{document_id}/copy", markers::COPY)
+ .unwrap_context("Router.insert failed");
+ router
+ .insert("/document/{document_id}/{*rest}", markers::REST)
+ .unwrap_context("Router.insert failed");
+ router
+});
+
+pub async fn pass_to_durable_object(
+ env: &Env,
+ req: Request,
+ document_id: &str,
+) -> Result<Response> {
+ let stub = get_durable_object(env, document_id)?;
+
+ let fut = timeout(stub.fetch_with_request(req), DEFAULT_TIMEOUT_MS);
+ let res = timeit_log!("worker -> do_fetch", fut.await);
+ Ok(match res {
+ crate::timeout::TimeoutResult::Ok(x) => x?,
+ crate::timeout::TimeoutResult::Timeout(timeout_error) => {
+ error!(err =? timeout_error, "A durable object RPC call has timed out");
+ response(408)
+ }
+ })
+}
+
+fn get_durable_object(env: &Env, document_id: &str) -> Result<Stub> {
+ env.durable_object(DURABLE_OBJECT_NAMESPACE)?
+ .id_from_name(document_id)?
+ .get_stub()
+}
diff --git a/rust/sync-service/src/constants.rs b/rust/sync-service/src/constants.rs
new file mode 100644
index 0000000000..4d3576e5c3
--- /dev/null
+++ b/rust/sync-service/src/constants.rs
@@ -0,0 +1,6 @@
+pub mod header_names {
+ pub const MACRO_INTERNAL_AUTH_KEY_HEADER_KEY: &str = "x-internal-auth-key";
+ pub const AUTHORIZATION: &str = "Authorization";
+}
+
+pub const USER_PEER_D1_BINDING: &str = "USER_PEER_MAPPING";
diff --git a/rust/sync-service/src/d1.rs b/rust/sync-service/src/d1.rs
new file mode 100644
index 0000000000..ce4dfcaf1c
--- /dev/null
+++ b/rust/sync-service/src/d1.rs
@@ -0,0 +1,90 @@
+use crate::timeit;
+use tracing::{error, trace};
+use worker::D1Database;
+pub async fn insert_user_mapping(
+ db: D1Database,
+ user_id: &str,
+ peer_id: u64,
+ document_id: &str,
+) -> worker::Result<()> {
+ let elapsed = timeit!({
+ let dbres = db.prepare(
+ "INSERT OR REPLACE INTO peer_user_map (document_id, peer_id, user_id) VALUES (?, ?, ?);",
+ )
+ .bind(&[
+ document_id.into(),
+ peer_id.to_string().into(),
+ user_id.into(),
+ ])?
+ .run()
+ .await?;
+ if let Some(e) = dbres.error() {
+ error!(
+ error = e,
+ user_id = user_id,
+ user_id = user_id,
+ document_id = document_id,
+ "Error within D1"
+ );
+ return Err(worker::Error::from(e));
+ }
+ dbres
+ })
+ .1;
+ trace!(
+ user_id = user_id,
+ user_id = user_id,
+ document_id = document_id,
+ duration_ms = elapsed.as_millis(),
+ "insert_peer_user_document_mapping"
+ );
+ Ok(())
+}
+
+pub async fn get_user_id_from_peer_id(
+ db: D1Database,
+ document_id: &str,
+ peer_id: &u64,
+) -> worker::Result<String> {
+ let statement = db.prepare(
+ "
+ SELECT user_id
+ FROM peer_user_map
+ WHERE document_id = ? AND peer_id = ?;
+ ",
+ );
+ let Some(user_id) = statement
+ .bind(&[document_id.into(), (*peer_id).to_string().into()])?
+ .first(Some("user_id"))
+ .await?
+ else {
+ return Err(worker::Error::from("no user found for peer id"));
+ };
+
+ Ok(user_id)
+}
+
+#[derive(serde::Deserialize, serde::Serialize)]
+pub struct PeerWithUserId {
+ pub peer_id: String,
+ pub user_id: String,
+}
+
+pub async fn get_peers_for_document_id(
+ db: D1Database,
+ document_id: &str,
+) -> worker::Result<Vec<PeerWithUserId>> {
+ let statement = db.prepare(
+ "
+ SELECT peer_id, user_id
+ FROM peer_user_map
+ WHERE document_id = ?;
+ ",
+ );
+
+ let result = statement.bind(&[document_id.into()])?.all().await?;
+
+ let peers = result.results::<PeerWithUserId>()?;
+
+ Ok(peers)
+}
diff --git a/rust/sync-service/src/durable_object.rs b/rust/sync-service/src/durable_object.rs
new file mode 100644
index 0000000000..ef97d61ed6
--- /dev/null
+++ b/rust/sync-service/src/durable_object.rs
@@ -0,0 +1,994 @@
+use std::{
+ borrow::Cow,
+ collections::{BTreeMap, BTreeSet},
+ rc::Rc,
+ sync::{Arc, LazyLock},
+};
+
+use bebop::Record;
+use loro::{ExportMode, awareness::EphemeralStore};
+use matchit::Router;
+use serde::{Deserialize, Serialize};
+use tracing::{debug, error, info, instrument, trace, warn};
+use worker::{
+ Cors, Date, Env, Error, Method, Request, Response, ResponseBody, ResponseBuilder, Result,
+ ScheduledTime, State, WebSocket, WebSocketIncomingMessage, WebSocketPair, durable_object,
+};
+
+use crate::{
+ auth::{AccessLevel, TokenFrom, decode_jwt},
+ constants::USER_PEER_D1_BINDING,
+ d1::{PeerWithUserId, get_user_id_from_peer_id, insert_user_mapping},
+ error::ResultExt,
+ generated::schema::InitializeFromSnapshotRequest,
+ keepalive::{DEFAULT_TIME_TO_LIVE, keepalive},
+ mutex::Mutex,
+ state::DocumentState,
+ storage::{
+ SessionStorage, backends::durable_kv::DurableKVStorage, get_snapshot_storage,
+ snapshot::SnapshotStorage,
+ },
+ tags::{get_ws_id_from_tags, new_ws_id},
+ timeit, websocket,
+};
+
+pub const NO_SUCH_VALUE_ERR_STR: &str = "No such value in storage.";
+
+pub mod status_codes {
+ pub const OK: u16 = 200;
+ pub const NOT_FOUND: u16 = 404;
+ pub const UNAUTH: u16 = 401;
+ pub const FORBIDDEN: u16 = 403;
+}
+
+const DOCUMENT_ID_KEY: &str = "DOCUMENT_ID";
+
+mod path {
+ pub const CONNECT: &str = "connect";
+ pub const EXISTS: &str = "exists";
+ pub const INITIALIZE: &str = "initialize";
+ pub const RAW: &str = "raw";
+ pub const SNAPSHOT: &str = "snapshot";
+ pub const ACTIVE_PEERS_MARKER: &str = "active_peers";
+ pub const PEER: &str = "peer";
+ pub const METADATA: &str = "metadata";
+ pub const DEBUG_DUMP_OPERATIONS: &str = "debug_dump_operations";
+ pub const DEBUG_DO_KV_GET: &str = "debug_do_kv_get";
+ pub const DEBUG_DO_KV_LIST: &str = "debug_do_kv_list";
+ pub const WAKEUP: &str = "wakeup";
+}
+
+pub fn response(status_code: u16) -> Response {
+ Response::builder().with_status(status_code).empty()
+}
+
+#[macro_export]
+macro_rules! maybe_404 {
+ ($res:expr) => {
+ match $res {
+ Ok(x) => Ok(x),
+ Err(Error::JsError(s)) => {
+ if s.contains(NO_SUCH_VALUE_ERR_STR) {
+ return Ok(ResponseBuilder::new()
+ .with_status(status_codes::NOT_FOUND)
+ .empty());
+ } else {
+ Err(Error::JsError(s))
+ }
+ }
+ Err(e) => Err(e),
+ }
+ };
+}
+
+macro_rules! or_unauth {
+ ($none_if_unauth:expr) => {{
+ let out = match $none_if_unauth {
+ Some(x) => x,
+ None => return Ok(response(status_codes::UNAUTH)),
+ };
+ out
+ }};
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct WebSocketMetadata {
+ pub user_id: Option<String>,
+ pub access_level: AccessLevel,
+ #[serde(with = "u64_serde_strings")]
+ pub peer_ids: BTreeSet<u64>,
+}
+
+pub type WsMetaMap = BTreeMap<String, WebSocketMetadata>;
+
+#[durable_object]
+pub struct DocumentSyncSession {
+ state: State,
+ env: Env,
+ /// id of the document, comes from URL path
+ document_id: Mutex<Option<Arc<String>>>,
+ /// Current document state
+ document_state: Mutex<Option<Arc<DocumentState>>>,
+ /// Access to document related IO
+ session_storage: Mutex<Option<Rc<SessionStorage>>>,
+ awareness: EphemeralStore,
+ /// a map from websocket's ID's to websocket metadata
+ ws_meta_map: Arc<Mutex<WsMetaMap>>,
+ msg_buffer: Arc<Mutex<Vec<u8>>>,
+}
+
+mod u64_serde_strings {
+ use serde::{Deserialize, Deserializer, Serialize, Serializer};
+ use std::collections::BTreeSet;
+
+ pub fn serialize<S: Serializer>(
+ value: &BTreeSet<u64>,
+ serializer: S,
+ ) -> Result<S::Ok, S::Error> {
+ let string_set: BTreeSet<String> = value.iter().map(|x| x.to_string()).collect();
+ string_set.serialize(serializer)
+ }
+
+ pub fn deserialize<'de, D: Deserializer<'de>>(
+ deserializer: D,
+ ) -> Result<BTreeSet<u64>, D::Error> {
+ let string_set: BTreeSet<String> = BTreeSet::deserialize(deserializer)?;
+ string_set
+ .into_iter()
+ .map(|s| s.parse::<u64>().map_err(serde::de::Error::custom))
+ .collect()
+ }
+ #[cfg(test)]
+ mod test {
+ use super::*;
+ #[derive(Serialize, Deserialize)]
+ struct Foo {
+ #[serde(with = "super")]
+ set: BTreeSet<u64>,
+ }
+ #[test]
+ fn serde_u64_btree_set() -> std::result::Result<(), Box<dyn std::error::Error>> {
+ let data = BTreeSet::from([1_u64, u64::MAX, u64::MIN, 0, 42]);
+ let obj = Foo { set: data.clone() };
+ let json = serde_json::to_string(&obj)?;
+ let result: Foo = serde_json::from_str(&json)?;
+ assert_eq!(result.set, data);
+ Ok(())
+ }
+ }
+}
+
+pub struct Wsm<'a> {
+ dss: &'a DocumentSyncSession,
+ ws: &'a WebSocket,
+ ws_id: Option<String>,
+}
+impl<'a> Wsm<'a> {
+ pub fn new(dss: &'a DocumentSyncSession, ws: &'a WebSocket) -> Self {
+ Self {
+ dss,
+ ws,
+ ws_id: None,
+ }
+ }
+ fn get_ws_id(&mut self) -> Result<&str> {
+ if self.ws_id.is_none() {
+ let tags = self.dss.state.get_tags(self.ws);
+ let ws_id = get_ws_id_from_tags(&tags)?;
+ self.ws_id = Some(ws_id);
+ }
+ Ok(self.ws_id.as_ref().unwrap())
+ }
+ async fn maybe_update_ws_meta_map(&mut self) -> Result<()> {
+ let ws_id = self.get_ws_id()?.to_string();
+ if !self
+ .dss
+ .ws_meta_map
+ .lock("Wsm::maybe_update_ws_meta_map contains_key")
+ .contains_key(&ws_id)
+ {
+ let wsm: WebSocketMetadata = self.dss.state.storage().get(&ws_id).await?;
+ self.dss
+ .ws_meta_map
+ .lock("Wsm::maybe_update_ws_meta_map insert")
+ .insert(ws_id, wsm);
+ }
+ Ok(())
+ }
+ async fn get_peer_ids(&mut self) -> Result<Vec<u64>> {
+ self.maybe_update_ws_meta_map().await?;
+ let ws_id = self.get_ws_id()?.to_string();
+ Ok(self
+ .dss
+ .ws_meta_map
+ .lock("Wsm::get_peer_ids get")
+ .get(&ws_id)
+ .ok_or(Error::from("missing ws metadata"))?
+ .peer_ids
+ .iter()
+ .cloned()
+ .collect())
+ }
+
+ pub async fn can_edit(&mut self) -> Result<bool> {
+ self.maybe_update_ws_meta_map().await?;
+ let ws_id = self.get_ws_id()?.to_string();
+ Ok(self
+ .dss
+ .ws_meta_map
+ .lock("Wsm::can_edit get")
+ .get(&ws_id)
+ .ok_or(Error::from("missing ws metadata"))?
+ .access_level
+ .can_edit())
+ }
+
+ pub async fn add_new_peerid(&mut self, peerid: u64, document_id: &str) -> Result<()> {
+ self.maybe_update_ws_meta_map().await?;
+
+ let ws_id = self.get_ws_id()?.to_string();
+
+ let new_peer = {
+ let mut wmm = self.dss.ws_meta_map.lock("Wsm::add_new_peerid get_mut");
+ let meta = wmm
+ .get_mut(&ws_id)
+ .ok_or(Error::from("missing ws metadata"))?;
+
+ if meta.peer_ids.insert(peerid) {
+ Some(meta.clone())
+ } else {
+ None
+ }
+ };
+ if let Some(meta) = new_peer {
+ self.dss.state.storage().put(&ws_id, &meta).await?;
+ // if user is not-anon
+ if let Some(user_id) = meta.user_id {
+ let db = self.dss.env.d1(USER_PEER_D1_BINDING)?;
+ insert_user_mapping(db, &user_id, peerid, document_id).await?;
+ }
+ }
+ Ok(())
+ }
+}
+pub fn get_ws_id(state: &State, ws: &WebSocket) -> Result<String> {
+ let tags = state.get_tags(ws);
+ get_ws_id_from_tags(&tags)
+}
+
+/// Schedule an alarm 5 seconds from now.
+async fn bump_alarm(state: &State) -> Result<()> {
+ let current_alarm = state.storage().get_alarm().await?;
+
+ if let Some(current_alarm) = current_alarm
+ && current_alarm as f64 > Date::now().as_millis() as f64
+ {
+ return Ok(());
+ }
+
+ state.storage().set_alarm(ScheduledTime::from(5000)).await?;
+
+ Ok(())
+}
+
+impl DocumentSyncSession {
+ pub fn get_websockets(&self) -> Vec<WebSocket> {
+ self.state.get_websockets()
+ }
+ async fn inner_fetch(&self, req: Request) -> Result<Response> {
+ let url = req.url()?;
+ let matched = ROUTER
+ .at(url.path())
+ .with_context(|| format!("Failed to route url: [{url}]"))?;
+
+ match (
+ *matched.value,
+ matched.params.get("document_id").inspect(|document_id| {
+ trace!(route =? matched.value, document_id = document_id, "matched route");
+ }),
+ ) {
+ // connect authenticates via jwt in query
+ (path::CONNECT, Some(document_id)) => {
+ return self.connect_handler(req, document_id).await;
+ }
+
+ // EXIST, PEER, and WAKEUP don't require auth
+ (path_needs_claims, Some(document_id)) => match path_needs_claims {
+ path::EXISTS => return self.exists_handler(document_id).await,
+ path::PEER => {
+ return self
+ .peer_handler(document_id, matched.params.get("peer_id"))
+ .await;
+ }
+ path::WAKEUP => self.wakeup(),
+ // These need auth
+ rest => {
+ let claims = or_unauth!(decode_jwt(&req, &self.env, TokenFrom::Headers).ok());
+ or_unauth!(claims.has_document_id_access(document_id).then_some(()));
+ match rest {
+ path::METADATA => return self.metadata_handler(document_id).await,
+ path::RAW => return self.raw_handler(document_id).await,
+ path::SNAPSHOT => return self.snapshot_handler(req, document_id).await,
+ path::ACTIVE_PEERS_MARKER => return self.active_peer_ids_handler().await,
+ path::INITIALIZE => {
+ or_unauth!(claims.has_permission(&AccessLevel::Owner).then_some(()));
+ return self.initialize_handler(req, document_id).await;
+ }
+ path::DEBUG_DUMP_OPERATIONS => {
+ or_unauth!(claims.has_permission(&AccessLevel::Admin).then_some(()));
+ return self.dump_operations(document_id).await;
+ }
+ path::DEBUG_DO_KV_GET => {
+ or_unauth!(claims.has_permission(&AccessLevel::Admin).then_some(()));
+ let key = matched.params.get("key").context("missing key argoument")?;
+ let value = self.session_storage().await?.debug_do_kv_get(key).await?;
+ Response::from_json(&value)
+ }
+ path::DEBUG_DO_KV_LIST => {
+ or_unauth!(claims.has_permission(&AccessLevel::Admin).then_some(()));
+ let prefix = matched
+ .params
+ .get("prefix")
+ .context("missing prefix argoument")?;
+ let kvs: Vec<(String, Vec<u8>)> = self
+ .session_storage()
+ .await?
+ .debug_list_do_kv(prefix)
+ .await?
+ .into_iter()
+ .filter_map(|kv| kv.ok())
+ .collect();
+ Response::from_json(&kvs)
+ }
+ _ => Ok(response(status_codes::NOT_FOUND)),
+ }
+ }
+ },
+ (_, None) => Ok(response(status_codes::NOT_FOUND)),
+ }
+ }
+
+ async fn initialize_handler(&self, mut req: Request, document_id: &str) -> Result<Response> {
+ // NB: we expect DocumentSyncSession to not be initialized. If it is initialized, it's an error.
+ let storage = get_snapshot_storage(&self.env, &self.state, document_id.to_string())?;
+
+ if storage.has_snapshot().await? {
+ return Err(Error::from("snapshot already exists"));
+ } else {
+ debug!(document_id = document_id, "Initializing snapshot");
+ let body_raw = req.bytes().await?;
+ let body = InitializeFromSnapshotRequest::deserialize(&body_raw).with_context(|| format!("Failed to deserialize InitializeFromSnapshotRequest with document_id: [{document_id}]"))?;
+ storage.store_snapshot(&body.snapshot).await?;
+ *self
+ .document_id
+ .lock("DocumentSyncSession::document_id set within initialize_handler") =
+ Some(Arc::new(document_id.to_string()));
+ self.state
+ .storage()
+ .put(DOCUMENT_ID_KEY, document_id.to_string())
+ .await?;
+ let dkv_storage = DurableKVStorage::new(self.state.storage());
+ let session_storage = Rc::new(SessionStorage::new(storage, dkv_storage));
+ *self
+ .session_storage
+ .lock("DocumentSyncSession::session_storage set within initialize_handler") =
+ Some(session_storage);
+ }
+ Response::empty()
+ }
+
+ async fn active_peer_ids_handler(&self) -> Result<Response> {
+ let mut peer_ids: BTreeSet<u64> = BTreeSet::new();
+ for ws in self.state.get_websockets() {
+ let new_peer_ids = Wsm::new(self, &ws).get_peer_ids().await?;
+ peer_ids.extend(new_peer_ids);
+ }
+ let str_ids = peer_ids
+ .into_iter()
+ .map(|p| p.to_string())
+ .collect::<Vec<String>>();
+
+ let result = serde_json::to_vec(&str_ids).context("Failed to serialize ids")?;
+ Ok(ResponseBuilder::new().body(ResponseBody::Body(result)))
+ }
+
+ async fn exists_handler(&self, id: &str) -> Result<Response> {
+ Ok(response(if self.exists(id).await? {
+ status_codes::OK
+ } else {
+ status_codes::NOT_FOUND
+ }))
+ }
+
+ async fn raw_handler(&self, document_id: &str) -> Result<Response> {
+ if !self.exists(document_id).await? {
+ return Ok(response(status_codes::NOT_FOUND));
+ }
+ let out = maybe_404!(self.document_state().await)?.get_json();
+ Ok(ResponseBuilder::new().body(ResponseBody::Body(out.into_bytes())))
+ }
+
+ async fn snapshot_handler(&self, mut req: Request, document_id: &str) -> Result<Response> {
+ if !self.exists(document_id).await? {
+ return Ok(response(status_codes::NOT_FOUND));
+ }
+
+ let bytes = req.bytes().await?;
+ let body: Option<GetSnapshotRequest> = if bytes.is_empty() {
+ None
+ } else {
+ Some(serde_json::from_slice(&bytes)?)
+ };
+
+ let frontiers: Option<ExportMode> = body.and_then(|b| {
+ if let Some(vid) = b.version_id {
+ let id = loro::ID::new(vid.peer.parse::<u64>().unwrap(), vid.counter);
+ Some(ExportMode::StateOnly(Some(Cow::Owned(
+ loro::Frontiers::ID(id),
+ ))))
+ } else {
+ None
+ }
+ });
+
+ let out = maybe_404!(self.document_state().await)?
+ .export_snapshot(frontiers)
+ .context("Couldn't export snapshot")?;
+ Ok(ResponseBuilder::new().body(ResponseBody::Body(out)))
+ }
+
+ async fn dump_operations(&self, document_id: &str) -> Result<Response> {
+ if !self.exists(document_id).await? {
+ return Ok(response(status_codes::NOT_FOUND));
+ }
+ let pending_ops = self
+ .session_storage()
+ .await?
+ .get_pending_operations()
+ .await?;
+
+ let n_pending_ops = pending_ops.len();
+ trace!(
+ pending_ops_len = n_pending_ops,
+ "Applying [{}] pending ops", n_pending_ops
+ );
+
+ let mut ers = vec![];
+ let mut key_ops = vec![];
+ for res_op in pending_ops {
+ match res_op {
+ Ok((k, o)) => key_ops.push((k, o)),
+ Err(e) => ers.push(e),
+ }
+ }
+ if !ers.is_empty() {
+ error!(errors =? ers, "DO KV operations got [{}] errors", ers.len());
+ }
+
+ ResponseBuilder::new().from_json(&key_ops)
+ }
+
+ async fn peer_handler(&self, document_id: &str, peer_id: Option<&str>) -> Result<Response> {
+ let (user_id, peer_id) = if let Some(p) = peer_id {
+ let p64: u64 = p
+ .parse()
+ .with_context(|| format!("Couldn't parse peer_id: '{p}' into u64"))?;
+ let db = self.env.d1(USER_PEER_D1_BINDING)?;
+ let user_id = get_user_id_from_peer_id(db, document_id, &p64).await?;
+ (user_id, p.to_string())
+ } else {
+ return Err(Error::from("missing `peer_id` in path"));
+ };
+ ResponseBuilder::new().from_json(&PeerResponse { peer_id, user_id })
+ }
+
+ fn wakeup(&self) -> Result<Response> {
+ let out = keepalive(DEFAULT_TIME_TO_LIVE);
+ ResponseBuilder::new().from_json(&out)
+ }
+
+ async fn metadata_handler(&self, document_id: &str) -> Result<Response> {
+ if !self.exists(document_id).await? {
+ return Ok(response(status_codes::NOT_FOUND));
+ }
+ let db = self.env.d1(USER_PEER_D1_BINDING)?;
+ let peers = crate::d1::get_peers_for_document_id(db, document_id).await?;
+ let version_id = self.document_state().await?.version_id();
+ ResponseBuilder::new().from_json(&DocumentMetadata {
+ peers,
+ version_id: version_id.to_string(),
+ id: document_id.to_string(),
+ })
+ }
+
+ async fn connect_handler(&self, req: Request, document_id: &str) -> Result<Response> {
+ let (res, elap) = timeit!({
+ let claims = or_unauth!(decode_jwt(&req, &self.env, TokenFrom::QueryParams).ok());
+ self.maybe_set_document_id(document_id).await?;
+
+ // Below is websocket stuff only i.e connect
+ let pair = WebSocketPair::new().context("failed to create websocket pair")?;
+
+ // create tag for ws and store it
+ let ws_id = new_ws_id();
+ trace!(ws_id = ws_id, "websocket connect");
+
+ self.state
+ .accept_websocket_with_tags(&pair.server, &[&ws_id]);
+
+ let ws_meta = WebSocketMetadata {
+ user_id: claims.user_id,
+ access_level: claims.access_level,
+ peer_ids: Default::default(),
+ };
+
+ self.state.storage().put(&ws_id, &ws_meta).await?;
+ self.ws_meta_map
+ .lock("DocumentSyncSession::ws_meta_map insert in connect_handler")
+ .insert(ws_id, ws_meta);
+
+ let snapshot = self
+ .document_state()
+ .await?
+ .export_shallow_snapshot()
+ .context("failed to export snapshot")?;
+
+ trace!("got_snapshot_len = {}", snapshot.len());
+ websocket::send_initial_sync(
+ &pair.server,
+ snapshot.as_slice(),
+ self.awareness.encode_all().as_slice(),
+ self.msg_buffer.clone(),
+ )
+ .context("failed to send initial sync message")?;
+
+ Response::from_websocket(pair.client).context("failed to create websocket response")?
+ });
+
+ trace!(
+ document_id = document_id,
+ duration_ms = elap.as_millis(),
+ "DO::connect"
+ );
+ Ok(res)
+ }
+
+ async fn maybe_set_document_id(&self, document_id: &str) -> Result<()> {
+ if !self.document_id_is_some() {
+ debug!("Setting DO::kv({DOCUMENT_ID_KEY}, {document_id})");
+ self.state
+ .storage()
+ .put(DOCUMENT_ID_KEY, document_id)
+ .await?;
+ *self
+ .document_id
+ .lock("DocumentSyncSession::document_id set within maybe_set_document_id") =
+ Some(Arc::new(document_id.to_string()));
+ }
+ Ok(())
+ }
+
+ /// Check if provided document_id exists.
+ /// 1. is self.document_id set
+ /// 2. is document_id it do::kv
+ /// 3. does snapshot exist with document_id?
+ async fn exists(&self, document_id: &str) -> Result<bool> {
+ if self.document_id_is_some() {
+ return Ok(true);
+ }
+ // This gets document_id via dokv if it exists
+ if self.document_id().await.is_ok() {
+ return Ok(true);
+ }
+ // self.session_storage would not be set because it requires self.document_id be set
+ let snapshot_storage =
+ get_snapshot_storage(&self.env, &self.state, document_id.to_string())?;
+
+ if snapshot_storage.has_snapshot().await? {
+ self.maybe_set_document_id(document_id).await?;
+ // set up session storage
+ let dkv_storage = DurableKVStorage::new(self.state.storage());
+ let session_storage = Rc::new(SessionStorage::new(snapshot_storage, dkv_storage));
+ *self
+ .session_storage
+ .lock("DocumentSyncSession::session_storage set within exists") =
+ Some(session_storage);
+ return Ok(true);
+ }
+ Ok(false)
+ }
+
+ fn document_id_is_some(&self) -> bool {
+ self.document_id
+ .lock("DocumentSyncSession::document_id check is_some()")
+ .is_some()
+ }
+
+ #[instrument(skip_all, err)]
+ /// Get the `document_id`. First try checking self.document_id, if not there get from DOKV.
+ async fn document_id(&self) -> Result<Arc<String>> {
+ if let Some(id) = self
+ .document_id
+ .lock("DocumentSyncSession::document_id get within main document_id fn")
+ .as_ref()
+ .cloned()
+ {
+ return Ok(id);
+ }
+ let id: Arc<String> = Arc::new(
+ self.state
+ .storage()
+ .get(DOCUMENT_ID_KEY)
+ .await
+ .with_context(|| {
+ format!(
+ "Could not get document_id via DOCUMENT_ID_KEY = [{}] from DO storage",
+ DOCUMENT_ID_KEY
+ )
+ })?,
+ );
+ *self
+ .document_id
+ .lock("DocumentSyncSession::document_id set within main document_id fn") =
+ Some(id.clone());
+ Ok(id)
+ }
+
+ async fn session_storage(&self) -> Result<Rc<SessionStorage>> {
+ if let Some(ss) = self
+ .session_storage
+ .lock("session_storage get within main session_storage fn")
+ .as_ref()
+ {
+ Ok(ss.clone())
+ } else {
+ let id = self.document_id().await?.to_string();
+ let snapshot_storage = get_snapshot_storage(&self.env, &self.state, id.clone())?;
+ let dkv_storage = DurableKVStorage::new(self.state.storage());
+ let ss = Rc::new(SessionStorage::new(snapshot_storage, dkv_storage));
+ *self
+ .session_storage
+ .lock("DocumentSyncSession::session_storage set within main session_storage fn") =
+ Some(ss.clone());
+ Ok(ss)
+ }
+ }
+
+ /// Gets DocumentState, loading it if needed
+ async fn document_state(&self) -> Result<Arc<DocumentState>> {
+ let Some(x) = self
+ .document_state
+ .lock("DocumentSyncSession::document_state get within main document_state fn")
+ .as_ref()
+ .cloned()
+ else {
+ let ss = Arc::new(self.session_storage().await?.load_document_state().await?);
+ *self
+ .document_state
+ .lock("DocumentSyncSession::document_state set within main document_state fn") =
+ Some(ss.clone());
+ return Ok(ss);
+ };
+ Ok(x)
+ }
+}
+
+pub static ROUTER: LazyLock<Router<&str>> = LazyLock::new(|| {
+ let mut router = Router::new();
+ router
+ .insert("/document/{document_id}/connect", path::CONNECT)
+ .unwrap();
+ router
+ .insert("/document/{document_id}/exists", path::EXISTS)
+ .unwrap();
+ router
+ .insert("/document/{document_id}/initialize", path::INITIALIZE)
+ .unwrap();
+ router
+ .insert("/document/{document_id}/raw", path::RAW)
+ .unwrap();
+ router
+ .insert(
+ "/document/{document_id}/active_peers",
+ path::ACTIVE_PEERS_MARKER,
+ )
+ .unwrap();
+ router
+ .insert("/document/{document_id}/snapshot", path::SNAPSHOT)
+ .unwrap();
+ router
+ .insert("/document/{document_id}/peer/{peer_id}", path::PEER)
+ .unwrap();
+ router
+ .insert("/document/{document_id}/metadata", path::METADATA)
+ .unwrap();
+ router
+ .insert(
+ "/document/{document_id}/debug_dump_operations",
+ path::DEBUG_DUMP_OPERATIONS,
+ )
+ .unwrap();
+ router
+ .insert(
+ "/document/{document_id}/debug_do_kv_get/{key}",
+ path::DEBUG_DO_KV_GET,
+ )
+ .unwrap();
+ router
+ .insert(
+ "/document/{document_id}/debug_do_kv_list/{prefix}",
+ path::DEBUG_DO_KV_LIST,
+ )
+ .unwrap();
+ router
+ .insert("/document/{document_id}/wakeup", path::WAKEUP)
+ .unwrap();
+ router
+});
+
+impl DurableObject for DocumentSyncSession {
+ fn new(state: State, env: Env) -> Self {
+ Self {
+ state,
+ env,
+ document_id: Mutex::new(None),
+ document_state: Mutex::new(None),
+ session_storage: Mutex::new(None),
+ awareness: EphemeralStore::new(5_000),
+ ws_meta_map: Arc::new(Mutex::new(Default::default())),
+ msg_buffer: Arc::new(Mutex::new(vec![])),
+ }
+ }
+
+ /// Fetch the durable object
+ /// Upgrades the request to a websocket request connected to the document session
+ async fn fetch(&self, req: Request) -> Result<Response> {
+ let set_allow_origin = if let Some(origin) = req
+ .headers()
+ .get("Origin")
+ .context("No `Origin` header found in header")?
+ {
+ if is_origin_allowed(&origin) {
+ Some(origin)
+ } else {
+ return Ok(response(status_codes::FORBIDDEN));
+ }
+ } else {
+ None
+ };
+
+ if req.method() == Method::Options {
+ return Ok(Response::builder()
+ .with_status(status_codes::OK)
+ .with_cors(&cors(set_allow_origin.as_deref()))?
+ .empty());
+ }
+ let res = self
+ .inner_fetch(req)
+ .await
+ .context("DurableObject::fetch error")?;
+ res.with_cors(&cors(set_allow_origin.as_deref()))
+ }
+
+ async fn websocket_message(&self, ws: WebSocket, msg: WebSocketIncomingMessage) -> Result<()> {
+ const PONG: &str = "pong";
+ const PING: &str = "ping";
+ let binary_message = match msg {
+ WebSocketIncomingMessage::String(message) => {
+ // TODO do keepalive?
+ if message == PING {
+ ws.send_with_str(PONG).ok();
+ } else {
+ warn!("Received unknown 'String' message: {message:?}");
+ }
+ return Ok(());
+ }
+ WebSocketIncomingMessage::Binary(bm) => bm,
+ };
+
+ websocket::process_message(
+ &ws,
+ &self.document_id().await?,
+ &*self.document_state().await?,
+ &*self.session_storage().await?,
+ &self.awareness,
+ binary_message,
+ self.msg_buffer.clone(),
+ self,
+ )
+ .await
+ .context("failed to process websocket message")?;
+
+ bump_alarm(&self.state)
+ .await
+ .context("failed to keep document alive")?;
+
+ Ok(())
+ }
+
+ /// Save document if needed
+ #[instrument(skip_all, err)]
+ async fn alarm(&self) -> Result<Response> {
+ let state = match self
+ .document_state()
+ .await
+ .context("failed to get document_state")
+ {
+ Ok(x) => x,
+ Err(_e) => {
+ // This is likely due to a programming issue. We don't return `Err`
+ // because it wuld cause this alarm to retry, then fail again.
+ return Response::empty();
+ }
+ };
+
+ if state.should_save() {
+ let seshs = self
+ .session_storage()
+ .await
+ .context("failed to get session storage")?;
+
+ // Keeps the worker alive for DEFAULT_TIME_TO_LIVE
+ keepalive(DEFAULT_TIME_TO_LIVE);
+
+ let doc_state = self.document_state().await?;
+ let (sf, of) = doc_state.frontiers();
+ seshs
+ .store_snapshot(&doc_state)
+ .await
+ .context("failed to store snapshot")?;
+
+ debug!(state_frontiers =? sf, oplog_frontiers =? of, "Stored new DocumentState");
+ seshs
+ .clear_applied_ops()
+ .await
+ .context("failed deleting applied ops")?;
+
+ state.mark_exported();
+ }
+
+ let sockets = self.state.get_websockets();
+
+ // on a schedule we should broadcast the current snapshot of the document
+ // to all connected clients
+ if !sockets.is_empty() {
+ bump_alarm(&self.state)
+ .await
+ .context("failed to keep document alive")?;
+
+ let snapshot = state
+ .export_shallow_snapshot()
+ .context("failed to export snapshot")?;
+
+ websocket::broadcast_snapshot(
+ sockets.as_slice(),
+ snapshot.as_slice(),
+ self.msg_buffer.clone(),
+ )
+ .context("failed to broadcast snapshot")?;
+ } else {
+ info!("durable object has reached 0 connections")
+ }
+
+ Response::ok("ok")
+ }
+
+ async fn websocket_close(
+ &self,
+ ws: WebSocket,
+ _code: usize,
+ _reason: String,
+ _was_clean: bool,
+ ) -> Result<()> {
+ let peer_ids = Wsm::new(self, &ws).get_peer_ids().await?;
+ for peer_id in peer_ids {
+ self.awareness.delete(&peer_id.to_string());
+ let update = self.awareness.encode(&peer_id.to_string());
+
+ // Don't silently discard the error
+ websocket::broadcast_awareness(
+ &ws,
+ self.state.get_websockets().as_slice(),
+ update.as_slice(),
+ self.msg_buffer.clone(),
+ )
+ .context("failed to broadcast awareness")?;
+ }
+
+ #[cfg(feature = "search-service")]
+ if self.state.get_websockets().len() == 1 {
+ crate::sps::update(&self.document_id().await?, &self.env).await?;
+ }
+ Ok(())
+ }
+
+ async fn websocket_error(&self, ws: WebSocket, error: Error) -> Result<()> {
+ let ws_id = get_ws_id(&self.state, &ws)?;
+ error!(ws_id = ws_id, error = ?error, "websocket error");
+ // TODO update awareness stuff
+ Ok(())
+ }
+}
+
+#[derive(serde::Serialize, serde::Deserialize, Debug)]
+pub struct VersionIndicator {
+ /// Json has trouble with peer id bigints, so we need to serialize from a string
+ pub peer: String,
+ pub counter: i32,
+}
+
+#[derive(serde::Deserialize, serde::Serialize, Debug)]
+pub struct CopyDocumentRequest {
+ pub target_document_id: String,
+ pub version_id: Option<VersionIndicator>,
+}
+
+#[derive(serde::Deserialize, serde::Serialize, Debug)]
+pub struct GetSnapshotRequest {
+ pub version_id: Option<VersionIndicator>,
+}
+
+#[derive(serde::Deserialize, serde::Serialize)]
+pub struct DocumentMetadata {
+ pub id: String,
+ pub peers: Vec<PeerWithUserId>,
+ pub version_id: String,
+}
+
+#[derive(serde::Serialize)]
+pub struct PeerResponse {
+ pub peer_id: String,
+ pub user_id: String,
+}
+
+pub static ALLOWED_ORIGINS: &[&str] = &[
+ "http://localhost:5173",
+ "http://localhost:3000",
+ "http://host.local:3000",
+ "https://dev.macro.com",
+ "https://staging.macro.com",
+ "https://www.macro.com",
+ "https://macro.com",
+ "capacitor://localhost",
+ "https://apollo-testing.macro.com",
+];
+
+pub fn is_origin_allowed(origin: &str) -> bool {
+ if ALLOWED_ORIGINS.contains(&origin) {
+ return true;
+ }
+ // Allow feature branch previews: https://{subdomain}.preview.macro.com
+ if let Some(host) = origin.strip_prefix("https://")
+ && let Some(subdomain) = host.strip_suffix(".preview.macro.com")
+ {
+ return !subdomain.is_empty() && !subdomain.contains('/');
+ }
+ false
+}
+
+/// Workaround for this bug: <https://github.com/cloudflare/workers-rs/issues/554>
+pub fn cors(request_origin: Option<&str>) -> Cors {
+ use worker::Method;
+ let cors_origins = request_origin
+ .map(|o| {
+ if is_origin_allowed(o) {
+ vec![o.to_string()]
+ } else {
+ vec![]
+ }
+ })
+ .unwrap_or_default();
+
+ Cors::new()
+ .with_credentials(true)
+ .with_allowed_headers(vec!["authorization", "content-type"])
+ .with_methods(vec![
+ Method::Get,
+ Method::Post,
+ Method::Put,
+ Method::Patch,
+ Method::Delete,
+ Method::Options,
+ ])
+ .with_origins(cors_origins)
+}
diff --git a/rust/sync-service/src/error.rs b/rust/sync-service/src/error.rs
new file mode 100644
index 0000000000..96861f5f45
--- /dev/null
+++ b/rust/sync-service/src/error.rs
@@ -0,0 +1,96 @@
+use std::{
+ convert::Infallible,
+ fmt::{Debug, Display},
+};
+use tracing::error;
+
+pub trait ResultExt<T, E> {
+ /// log the error and convert it to a worker::Error
+ fn context<C>(self, message: C) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static;
+
+ fn with_context<C, F>(self, f: F) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static,
+ F: FnOnce() -> C;
+
+ fn unwrap_context<C>(self, message: C) -> T
+ where
+ C: Display + Send + Sync + 'static;
+}
+
+impl<T, E: Debug> ResultExt<T, E> for Result<T, E> {
+ fn context<C>(self, message: C) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static,
+ {
+ self.map_err(|err| {
+ error!(err=?err, "{message}");
+ worker::Error::from(format!("{message} : {err:?}"))
+ })
+ }
+ fn with_context<C, F>(self, f: F) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static,
+ F: FnOnce() -> C,
+ {
+ self.map_err(|err| {
+ let message = f();
+ error!(err=?err, "{}", message);
+ worker::Error::from(format!("{message} : {err:?}"))
+ })
+ }
+ fn unwrap_context<C>(self, message: C) -> T
+ where
+ C: Display + Send + Sync + 'static,
+ {
+ match self {
+ Ok(x) => x,
+ Err(err) => {
+ error!(err=?err, "{}", message);
+ panic!("Called `unwrap_context` on an `Err` value");
+ }
+ }
+ }
+}
+impl<T> ResultExt<T, Infallible> for Option<T> {
+ fn context<C>(self, message: C) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static,
+ {
+ match self {
+ None => {
+ error!("{message}");
+ Err(worker::Error::from(format!("{message}")))
+ }
+ Some(x) => Ok(x),
+ }
+ }
+ fn with_context<C, F>(self, f: F) -> Result<T, worker::Error>
+ where
+ C: Display + Send + Sync + 'static,
+ F: FnOnce() -> C,
+ {
+ match self {
+ Some(x) => Ok(x),
+ None => {
+ let message = f();
+ error!("{}", message);
+ Err(worker::Error::from(format!("{message}")))
+ }
+ }
+ }
+ fn unwrap_context<C>(self, message: C) -> T
+ where
+ C: Display + Send + Sync + 'static,
+ {
+ match self {
+ Some(x) => x,
+ None => {
+ error!("{}", message);
+ panic!("Called `unwrap_context` on an `None` value");
+ }
+ }
+ }
+}
diff --git a/rust/sync-service/src/generated/mod.rs b/rust/sync-service/src/generated/mod.rs
new file mode 100644
index 0000000000..1ce7e17666
--- /dev/null
+++ b/rust/sync-service/src/generated/mod.rs
@@ -0,0 +1 @@
+pub mod schema;
diff --git a/rust/sync-service/src/generated/schema.rs b/rust/sync-service/src/generated/schema.rs
new file mode 100644
index 0000000000..c1a17c08f2
--- /dev/null
+++ b/rust/sync-service/src/generated/schema.rs
@@ -0,0 +1,988 @@
+//
+// This code was generated by a tool.
+//
+//
+// bebopc version:
+// 3.2.1
+//
+//
+// bebopc source:
+// https://github.com/6over3/bebop
+//
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+
+#![allow(warnings)]
+
+use bebop::FixedSized as _;
+use core::convert::TryInto as _;
+use std::io::Write as _;
+
+#[derive(Clone, Debug, PartialEq)]
+pub enum FromPeer<'raw> {
+ /// An unknown type which is likely defined in a newer version of the schema.
+ Unknown,
+
+ /// Discriminator 1
+ PeerUpdate {
+ update: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 2
+ PeerAwareness {
+ awareness: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 3
+ PeerRequestSince {
+ frontiers: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 4
+ PeerRequestSnapshot {},
+
+ /// Discriminator 5
+ PeerRegisterId { peerid: u64 },
+}
+
+impl<'raw> ::bebop::SubRecord<'raw> for FromPeer<'raw> {
+ const MIN_SERIALIZED_SIZE: usize = ::bebop::LEN_SIZE + 1;
+
+ fn serialized_size(&self) -> usize {
+ ::bebop::LEN_SIZE
+ + 1
+ + match self {
+ FromPeer::Unknown => 0,
+ Self::PeerUpdate { update: _update } => _update.serialized_size(),
+ Self::PeerAwareness {
+ awareness: _awareness,
+ } => _awareness.serialized_size(),
+ Self::PeerRequestSince {
+ frontiers: _frontiers,
+ } => _frontiers.serialized_size(),
+ Self::PeerRequestSnapshot {} => 0,
+ Self::PeerRegisterId { peerid: _peerid } => _peerid.serialized_size(),
+ }
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ let size = zelf.serialized_size();
+ ::bebop::write_len(dest, size - ::bebop::LEN_SIZE - 1)?;
+ match zelf {
+ Self::Unknown => {
+ return Err(::bebop::SerializeError::CannotSerializeUnknownUnion);
+ }
+ Self::PeerUpdate {
+ update:_update,
+ }
+ => {
+ 1u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::PeerAwareness {
+ awareness:_awareness,
+ }
+ => {
+ 2u8._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::PeerRequestSince {
+ frontiers:_frontiers,
+ }
+ => {
+ 3u8._serialize_chained(dest)?;
+ _frontiers._serialize_chained(dest)?;
+ }
+ Self::PeerRequestSnapshot {
+ }
+ => {
+ 4u8._serialize_chained(dest)?;
+ }
+ Self::PeerRegisterId {
+ peerid:_peerid,
+ }
+ => {
+ 5u8._serialize_chained(dest)?;
+ _peerid._serialize_chained(dest)?;
+ }
+ }
+ Ok(size)
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let len = ::bebop::read_len(raw)? + ::bebop::LEN_SIZE + 1;
+ let mut i = ::bebop::LEN_SIZE + 1;
+ let de = match raw[::bebop::LEN_SIZE] {
+ 1 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerUpdate { update: v0 }
+ }
+ 2 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerAwareness { awareness: v0 }
+ }
+ 3 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerRequestSince { frontiers: v0 }
+ }
+ 4 => FromPeer::PeerRequestSnapshot {},
+ 5 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerRegisterId { peerid: v0 }
+ }
+ _ => {
+ i = len;
+ FromPeer::Unknown
+ }
+ };
+ if !cfg!(feature = "unchecked") && i != len {
+ debug_assert!(i > len);
+ Err(::bebop::DeserializeError::CorruptFrame)
+ } else {
+ Ok((i, de))
+ }
+ }
+}
+
+impl<'raw> ::bebop::Record<'raw> for FromPeer<'raw> {}
+
+#[derive(Clone, Debug, PartialEq)]
+pub enum FromRemote<'raw> {
+ /// An unknown type which is likely defined in a newer version of the schema.
+ Unknown,
+
+ /// Discriminator 1
+ RemoteInitialSync {
+ snapshot: ::bebop::SliceWrapper<'raw, u8>,
+ awareness: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 2
+ RemoteUpdate {
+ update: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 3
+ RemoteAwareness {
+ awareness: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 4
+ RemoteSnapshot {
+ snapshot: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 5
+ RemoteUpdateAck {
+ update: ::bebop::SliceWrapper<'raw, u8>,
+ },
+
+ /// Discriminator 6
+ RemoteUpdateSince {
+ update: ::bebop::SliceWrapper<'raw, u8>,
+ frontiers: ::bebop::SliceWrapper<'raw, u8>,
+ },
+}
+
+impl<'raw> ::bebop::SubRecord<'raw> for FromRemote<'raw> {
+ const MIN_SERIALIZED_SIZE: usize = ::bebop::LEN_SIZE + 1;
+
+ fn serialized_size(&self) -> usize {
+ ::bebop::LEN_SIZE
+ + 1
+ + match self {
+ FromRemote::Unknown => 0,
+ Self::RemoteInitialSync {
+ snapshot: _snapshot,
+ awareness: _awareness,
+ } => _snapshot.serialized_size() + _awareness.serialized_size(),
+ Self::RemoteUpdate { update: _update } => _update.serialized_size(),
+ Self::RemoteAwareness {
+ awareness: _awareness,
+ } => _awareness.serialized_size(),
+ Self::RemoteSnapshot {
+ snapshot: _snapshot,
+ } => _snapshot.serialized_size(),
+ Self::RemoteUpdateAck { update: _update } => _update.serialized_size(),
+ Self::RemoteUpdateSince {
+ update: _update,
+ frontiers: _frontiers,
+ } => _update.serialized_size() + _frontiers.serialized_size(),
+ }
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ let size = zelf.serialized_size();
+ ::bebop::write_len(dest, size - ::bebop::LEN_SIZE - 1)?;
+ match zelf {
+ Self::Unknown => {
+ return Err(::bebop::SerializeError::CannotSerializeUnknownUnion);
+ }
+ Self::RemoteInitialSync {
+ snapshot:_snapshot,
+ awareness:_awareness,
+ }
+ => {
+ 1u8._serialize_chained(dest)?;
+ _snapshot._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdate {
+ update:_update,
+ }
+ => {
+ 2u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::RemoteAwareness {
+ awareness:_awareness,
+ }
+ => {
+ 3u8._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::RemoteSnapshot {
+ snapshot:_snapshot,
+ }
+ => {
+ 4u8._serialize_chained(dest)?;
+ _snapshot._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdateAck {
+ update:_update,
+ }
+ => {
+ 5u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdateSince {
+ update:_update,
+ frontiers:_frontiers,
+ }
+ => {
+ 6u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ _frontiers._serialize_chained(dest)?;
+ }
+ }
+ Ok(size)
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let len = ::bebop::read_len(raw)? + ::bebop::LEN_SIZE + 1;
+ let mut i = ::bebop::LEN_SIZE + 1;
+ let de = match raw[::bebop::LEN_SIZE] {
+ 1 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteInitialSync {
+ snapshot: v0,
+ awareness: v1,
+ }
+ }
+ 2 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdate { update: v0 }
+ }
+ 3 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteAwareness { awareness: v0 }
+ }
+ 4 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteSnapshot { snapshot: v0 }
+ }
+ 5 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdateAck { update: v0 }
+ }
+ 6 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdateSince {
+ update: v0,
+ frontiers: v1,
+ }
+ }
+ _ => {
+ i = len;
+ FromRemote::Unknown
+ }
+ };
+ if !cfg!(feature = "unchecked") && i != len {
+ debug_assert!(i > len);
+ Err(::bebop::DeserializeError::CorruptFrame)
+ } else {
+ Ok((i, de))
+ }
+ }
+}
+
+impl<'raw> ::bebop::Record<'raw> for FromRemote<'raw> {}
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct Operation<'raw> {
+ pub update: ::bebop::SliceWrapper<'raw, u8>,
+ pub timestamp: ::bebop::Date,
+}
+
+impl<'raw> ::bebop::SubRecord<'raw> for Operation<'raw> {
+ const MIN_SERIALIZED_SIZE: usize = <::bebop::SliceWrapper<'raw, u8>>::MIN_SERIALIZED_SIZE
+ + <::bebop::Date>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.update.serialized_size() + self.timestamp.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.update._serialize_chained(dest)? +
+ zelf.timestamp._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((
+ i,
+ Self {
+ update: v0,
+ timestamp: v1,
+ },
+ ))
+ }
+}
+
+impl<'raw> ::bebop::Record<'raw> for Operation<'raw> {}
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct OperationLog<'raw> {
+ pub operations: ::std::vec::Vec<Operation<'raw>>,
+}
+
+impl<'raw> ::bebop::SubRecord<'raw> for OperationLog<'raw> {
+ const MIN_SERIALIZED_SIZE: usize = <::std::vec::Vec<Operation<'raw>>>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.operations.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.operations._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((i, Self { operations: v0 }))
+ }
+}
+
+impl<'raw> ::bebop::Record<'raw> for OperationLog<'raw> {}
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct InitializeFromSnapshotRequest<'raw> {
+ pub snapshot: ::bebop::SliceWrapper<'raw, u8>,
+}
+
+impl<'raw> ::bebop::SubRecord<'raw> for InitializeFromSnapshotRequest<'raw> {
+ const MIN_SERIALIZED_SIZE: usize = <::bebop::SliceWrapper<'raw, u8>>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.snapshot.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.snapshot._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((i, Self { snapshot: v0 }))
+ }
+}
+
+impl<'raw> ::bebop::Record<'raw> for InitializeFromSnapshotRequest<'raw> {}
+
+#[cfg(feature = "bebop-owned-all")]
+pub mod owned {
+ #![allow(warnings)]
+
+ use bebop::FixedSized as _;
+ use core::convert::TryInto as _;
+ use std::io::Write as _;
+
+ #[derive(Clone, Debug, PartialEq)]
+ pub enum FromPeer {
+ /// An unknown type which is likely defined in a newer version of the schema.
+ Unknown,
+
+ /// Discriminator 1
+ PeerUpdate { update: ::std::vec::Vec<u8> },
+
+ /// Discriminator 2
+ PeerAwareness { awareness: ::std::vec::Vec<u8> },
+
+ /// Discriminator 3
+ PeerRequestSince { frontiers: ::std::vec::Vec<u8> },
+
+ /// Discriminator 4
+ PeerRequestSnapshot {},
+
+ /// Discriminator 5
+ PeerRegisterId { peerid: u64 },
+ }
+
+ impl<'raw> ::core::convert::From<super::FromPeer<'raw>> for FromPeer {
+ fn from(value: super::FromPeer) -> Self {
+ match value {
+ super::FromPeer::Unknown => Self::Unknown,
+ super::FromPeer::PeerUpdate { update: _update } => Self::PeerUpdate {
+ update: _update.iter().map(|value| value).collect(),
+ },
+ super::FromPeer::PeerAwareness {
+ awareness: _awareness,
+ } => Self::PeerAwareness {
+ awareness: _awareness.iter().map(|value| value).collect(),
+ },
+ super::FromPeer::PeerRequestSince {
+ frontiers: _frontiers,
+ } => Self::PeerRequestSince {
+ frontiers: _frontiers.iter().map(|value| value).collect(),
+ },
+ super::FromPeer::PeerRequestSnapshot {} => Self::PeerRequestSnapshot {},
+ super::FromPeer::PeerRegisterId { peerid: _peerid } => {
+ Self::PeerRegisterId { peerid: _peerid }
+ }
+ }
+ }
+ }
+ impl<'raw> ::bebop::SubRecord<'raw> for FromPeer {
+ const MIN_SERIALIZED_SIZE: usize = ::bebop::LEN_SIZE + 1;
+
+ fn serialized_size(&self) -> usize {
+ ::bebop::LEN_SIZE
+ + 1
+ + match self {
+ FromPeer::Unknown => 0,
+ Self::PeerUpdate { update: _update } => _update.serialized_size(),
+ Self::PeerAwareness {
+ awareness: _awareness,
+ } => _awareness.serialized_size(),
+ Self::PeerRequestSince {
+ frontiers: _frontiers,
+ } => _frontiers.serialized_size(),
+ Self::PeerRequestSnapshot {} => 0,
+ Self::PeerRegisterId { peerid: _peerid } => _peerid.serialized_size(),
+ }
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ let size = zelf.serialized_size();
+ ::bebop::write_len(dest, size - ::bebop::LEN_SIZE - 1)?;
+ match &zelf {
+ Self::Unknown => {
+ return Err(::bebop::SerializeError::CannotSerializeUnknownUnion);
+ }
+ Self::PeerUpdate {
+ update:_update,
+ }
+ => {
+ 1u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::PeerAwareness {
+ awareness:_awareness,
+ }
+ => {
+ 2u8._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::PeerRequestSince {
+ frontiers:_frontiers,
+ }
+ => {
+ 3u8._serialize_chained(dest)?;
+ _frontiers._serialize_chained(dest)?;
+ }
+ Self::PeerRequestSnapshot {
+ }
+ => {
+ 4u8._serialize_chained(dest)?;
+ }
+ Self::PeerRegisterId {
+ peerid:_peerid,
+ }
+ => {
+ 5u8._serialize_chained(dest)?;
+ _peerid._serialize_chained(dest)?;
+ }
+ }
+ Ok(size)
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let len = ::bebop::read_len(raw)? + ::bebop::LEN_SIZE + 1;
+ let mut i = ::bebop::LEN_SIZE + 1;
+ let de = match raw[::bebop::LEN_SIZE] {
+ 1 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerUpdate { update: v0 }
+ }
+ 2 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerAwareness { awareness: v0 }
+ }
+ 3 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerRequestSince { frontiers: v0 }
+ }
+ 4 => FromPeer::PeerRequestSnapshot {},
+ 5 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromPeer::PeerRegisterId { peerid: v0 }
+ }
+ _ => {
+ i = len;
+ FromPeer::Unknown
+ }
+ };
+ if !cfg!(feature = "unchecked") && i != len {
+ debug_assert!(i > len);
+ Err(::bebop::DeserializeError::CorruptFrame)
+ } else {
+ Ok((i, de))
+ }
+ }
+ }
+
+ impl<'raw> ::bebop::Record<'raw> for FromPeer {}
+
+ #[derive(Clone, Debug, PartialEq)]
+ pub enum FromRemote {
+ /// An unknown type which is likely defined in a newer version of the schema.
+ Unknown,
+
+ /// Discriminator 1
+ RemoteInitialSync {
+ snapshot: ::std::vec::Vec<u8>,
+ awareness: ::std::vec::Vec<u8>,
+ },
+
+ /// Discriminator 2
+ RemoteUpdate { update: ::std::vec::Vec<u8> },
+
+ /// Discriminator 3
+ RemoteAwareness { awareness: ::std::vec::Vec<u8> },
+
+ /// Discriminator 4
+ RemoteSnapshot { snapshot: ::std::vec::Vec<u8> },
+
+ /// Discriminator 5
+ RemoteUpdateAck { update: ::std::vec::Vec<u8> },
+
+ /// Discriminator 6
+ RemoteUpdateSince {
+ update: ::std::vec::Vec<u8>,
+ frontiers: ::std::vec::Vec<u8>,
+ },
+ }
+
+ impl<'raw> ::core::convert::From<super::FromRemote<'raw>> for FromRemote {
+ fn from(value: super::FromRemote) -> Self {
+ match value {
+ super::FromRemote::Unknown => Self::Unknown,
+ super::FromRemote::RemoteInitialSync {
+ snapshot: _snapshot,
+ awareness: _awareness,
+ } => Self::RemoteInitialSync {
+ snapshot: _snapshot.iter().map(|value| value).collect(),
+ awareness: _awareness.iter().map(|value| value).collect(),
+ },
+ super::FromRemote::RemoteUpdate { update: _update } => Self::RemoteUpdate {
+ update: _update.iter().map(|value| value).collect(),
+ },
+ super::FromRemote::RemoteAwareness {
+ awareness: _awareness,
+ } => Self::RemoteAwareness {
+ awareness: _awareness.iter().map(|value| value).collect(),
+ },
+ super::FromRemote::RemoteSnapshot {
+ snapshot: _snapshot,
+ } => Self::RemoteSnapshot {
+ snapshot: _snapshot.iter().map(|value| value).collect(),
+ },
+ super::FromRemote::RemoteUpdateAck { update: _update } => Self::RemoteUpdateAck {
+ update: _update.iter().map(|value| value).collect(),
+ },
+ super::FromRemote::RemoteUpdateSince {
+ update: _update,
+ frontiers: _frontiers,
+ } => Self::RemoteUpdateSince {
+ update: _update.iter().map(|value| value).collect(),
+ frontiers: _frontiers.iter().map(|value| value).collect(),
+ },
+ }
+ }
+ }
+ impl<'raw> ::bebop::SubRecord<'raw> for FromRemote {
+ const MIN_SERIALIZED_SIZE: usize = ::bebop::LEN_SIZE + 1;
+
+ fn serialized_size(&self) -> usize {
+ ::bebop::LEN_SIZE
+ + 1
+ + match self {
+ FromRemote::Unknown => 0,
+ Self::RemoteInitialSync {
+ snapshot: _snapshot,
+ awareness: _awareness,
+ } => _snapshot.serialized_size() + _awareness.serialized_size(),
+ Self::RemoteUpdate { update: _update } => _update.serialized_size(),
+ Self::RemoteAwareness {
+ awareness: _awareness,
+ } => _awareness.serialized_size(),
+ Self::RemoteSnapshot {
+ snapshot: _snapshot,
+ } => _snapshot.serialized_size(),
+ Self::RemoteUpdateAck { update: _update } => _update.serialized_size(),
+ Self::RemoteUpdateSince {
+ update: _update,
+ frontiers: _frontiers,
+ } => _update.serialized_size() + _frontiers.serialized_size(),
+ }
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ let size = zelf.serialized_size();
+ ::bebop::write_len(dest, size - ::bebop::LEN_SIZE - 1)?;
+ match &zelf {
+ Self::Unknown => {
+ return Err(::bebop::SerializeError::CannotSerializeUnknownUnion);
+ }
+ Self::RemoteInitialSync {
+ snapshot:_snapshot,
+ awareness:_awareness,
+ }
+ => {
+ 1u8._serialize_chained(dest)?;
+ _snapshot._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdate {
+ update:_update,
+ }
+ => {
+ 2u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::RemoteAwareness {
+ awareness:_awareness,
+ }
+ => {
+ 3u8._serialize_chained(dest)?;
+ _awareness._serialize_chained(dest)?;
+ }
+ Self::RemoteSnapshot {
+ snapshot:_snapshot,
+ }
+ => {
+ 4u8._serialize_chained(dest)?;
+ _snapshot._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdateAck {
+ update:_update,
+ }
+ => {
+ 5u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ }
+ Self::RemoteUpdateSince {
+ update:_update,
+ frontiers:_frontiers,
+ }
+ => {
+ 6u8._serialize_chained(dest)?;
+ _update._serialize_chained(dest)?;
+ _frontiers._serialize_chained(dest)?;
+ }
+ }
+ Ok(size)
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let len = ::bebop::read_len(raw)? + ::bebop::LEN_SIZE + 1;
+ let mut i = ::bebop::LEN_SIZE + 1;
+ let de = match raw[::bebop::LEN_SIZE] {
+ 1 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteInitialSync {
+ snapshot: v0,
+ awareness: v1,
+ }
+ }
+ 2 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdate { update: v0 }
+ }
+ 3 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteAwareness { awareness: v0 }
+ }
+ 4 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteSnapshot { snapshot: v0 }
+ }
+ 5 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdateAck { update: v0 }
+ }
+ 6 => {
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ FromRemote::RemoteUpdateSince {
+ update: v0,
+ frontiers: v1,
+ }
+ }
+ _ => {
+ i = len;
+ FromRemote::Unknown
+ }
+ };
+ if !cfg!(feature = "unchecked") && i != len {
+ debug_assert!(i > len);
+ Err(::bebop::DeserializeError::CorruptFrame)
+ } else {
+ Ok((i, de))
+ }
+ }
+ }
+
+ impl<'raw> ::bebop::Record<'raw> for FromRemote {}
+
+ #[derive(Clone, Debug, PartialEq)]
+ pub struct Operation {
+ pub update: ::std::vec::Vec<u8>,
+ pub timestamp: ::bebop::Date,
+ }
+
+ impl<'raw> ::core::convert::From<super::Operation<'raw>> for Operation {
+ fn from(value: super::Operation) -> Self {
+ Self {
+ update: value.update.iter().map(|value| value).collect(),
+ timestamp: value.timestamp,
+ }
+ }
+ }
+
+ impl<'raw> ::bebop::SubRecord<'raw> for Operation {
+ const MIN_SERIALIZED_SIZE: usize =
+ <::std::vec::Vec<u8>>::MIN_SERIALIZED_SIZE + <::bebop::Date>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.update.serialized_size() + self.timestamp.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.update._serialize_chained(dest)? +
+ zelf.timestamp._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+ let (read, v1) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((
+ i,
+ Self {
+ update: v0,
+ timestamp: v1,
+ },
+ ))
+ }
+ }
+
+ impl<'raw> ::bebop::Record<'raw> for Operation {}
+
+ #[derive(Clone, Debug, PartialEq)]
+ pub struct OperationLog {
+ pub operations: ::std::vec::Vec<Operation>,
+ }
+
+ impl<'raw> ::core::convert::From<super::OperationLog<'raw>> for OperationLog {
+ fn from(value: super::OperationLog) -> Self {
+ Self {
+ operations: value
+ .operations
+ .into_iter()
+ .map(|value| value.into())
+ .collect(),
+ }
+ }
+ }
+
+ impl<'raw> ::bebop::SubRecord<'raw> for OperationLog {
+ const MIN_SERIALIZED_SIZE: usize = <::std::vec::Vec<Operation>>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.operations.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.operations._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((i, Self { operations: v0 }))
+ }
+ }
+
+ impl<'raw> ::bebop::Record<'raw> for OperationLog {}
+
+ #[derive(Clone, Debug, PartialEq)]
+ pub struct InitializeFromSnapshotRequest {
+ pub snapshot: ::std::vec::Vec<u8>,
+ }
+
+ impl<'raw> ::core::convert::From<super::InitializeFromSnapshotRequest<'raw>>
+ for InitializeFromSnapshotRequest
+ {
+ fn from(value: super::InitializeFromSnapshotRequest) -> Self {
+ Self {
+ snapshot: value.snapshot.iter().map(|value| value).collect(),
+ }
+ }
+ }
+
+ impl<'raw> ::bebop::SubRecord<'raw> for InitializeFromSnapshotRequest {
+ const MIN_SERIALIZED_SIZE: usize = <::std::vec::Vec<u8>>::MIN_SERIALIZED_SIZE;
+
+ #[inline]
+ fn serialized_size(&self) -> usize {
+ self.snapshot.serialized_size()
+ }
+
+ ::bebop::define_serialize_chained!(Self => |zelf, dest| {
+ Ok(
+ zelf.snapshot._serialize_chained(dest)?
+ )
+ });
+
+ fn _deserialize_chained(raw: &'raw [u8]) -> ::bebop::DeResult<(usize, Self)> {
+ let mut i = 0;
+ if raw.len() - i < Self::MIN_SERIALIZED_SIZE {
+ let missing = Self::MIN_SERIALIZED_SIZE - (raw.len() - i);
+ return Err(::bebop::DeserializeError::MoreDataExpected(missing));
+ }
+
+ let (read, v0) = ::bebop::SubRecord::_deserialize_chained(&raw[i..])?;
+ i += read;
+
+ Ok((i, Self { snapshot: v0 }))
+ }
+ }
+
+ impl<'raw> ::bebop::Record<'raw> for InitializeFromSnapshotRequest {}
+}
diff --git a/rust/sync-service/src/keepalive.rs b/rust/sync-service/src/keepalive.rs
new file mode 100644
index 0000000000..4e4f225b75
--- /dev/null
+++ b/rust/sync-service/src/keepalive.rs
@@ -0,0 +1,49 @@
+use std::time::Duration;
+use tracing::trace;
+use worker::{
+ js_sys,
+ wasm_bindgen::{JsCast, prelude::Closure},
+};
+
+use crate::{error::ResultExt, mutex::Mutex};
+
+pub const DEFAULT_TIME_TO_LIVE: Duration = Duration::from_secs(60);
+
+static CURRENT_TIMEOUT_ID: Mutex<Option<(i32, i32)>> = Mutex::new(None);
+
+/// Keeps the worker alive for at least `ttl: Duration` using JavaScript's `setTimeout`.
+/// It replaces any existing ttl, and returns the `setTimeout`'s timeout ID.
+pub fn keepalive(ttl: Duration) -> Option<(i32, i32)> {
+ let closure = Closure::wrap(Box::new(move || {
+ *CURRENT_TIMEOUT_ID.lock("keepalive clear CURRENT_TIMEOUT_ID") = None;
+ }) as Box<dyn FnMut()>);
+
+ let global: worker::worker_sys::web_sys::WorkerGlobalScope = js_sys::global().unchecked_into();
+
+ let mut out = None;
+ let mut current_id = CURRENT_TIMEOUT_ID.lock("keepalive set CURRENT_TIMEOUT_ID");
+
+ if let Some((prev_timeout_id, prev_duration_millis)) = *current_id {
+ global.clear_timeout_with_handle(prev_timeout_id);
+ out = Some((prev_timeout_id, prev_duration_millis));
+ }
+
+ let duration_millis = ttl.as_millis() as i32;
+ if let Ok(timeout_id) = global
+ .set_timeout_with_callback_and_timeout_and_arguments_0(
+ closure.as_ref().unchecked_ref(),
+ duration_millis,
+ )
+ .context("Failed to create timeout. Something really weird is happening")
+ {
+ trace!(
+ timeout_id = timeout_id,
+ timeout_duration_ms = duration_millis,
+ "created set_timeout"
+ );
+ *current_id = Some((timeout_id, duration_millis));
+ }
+
+ closure.forget();
+ out
+}
diff --git a/rust/sync-service/src/lib.rs b/rust/sync-service/src/lib.rs
new file mode 100644
index 0000000000..732e7befce
--- /dev/null
+++ b/rust/sync-service/src/lib.rs
@@ -0,0 +1,68 @@
+mod auth;
+mod cf_worker;
+mod constants;
+mod d1;
+mod durable_object;
+mod error;
+mod generated;
+pub mod keepalive;
+mod metrics;
+mod mutex;
+mod secrets;
+#[cfg(feature = "search-service")]
+mod sps;
+mod state;
+mod storage;
+mod tags;
+mod timeout;
+mod websocket;
+
+use tracing_subscriber::{
+ EnvFilter, fmt::time::UtcTime, layer::SubscriberExt, util::SubscriberInitExt,
+};
+use worker::{Context, Env, Result, event};
+
+pub const GIT_DESCRIBE: &str = env!("GIT_DESCRIBE");
+
+fn inner_start() {
+ let filter = EnvFilter::new("sync_service=trace,loro=warn");
+
+ let fmt_layer = tracing_subscriber::fmt::layer()
+ .json()
+ .with_file(true)
+ .with_target(true)
+ .with_line_number(true)
+ .with_level(true)
+ .with_ansi(false)
+ .with_timer(UtcTime::rfc_3339());
+
+ let layered = tracing_subscriber::registry().with(filter);
+
+ #[cfg(target_arch = "wasm32")]
+ {
+ use tracing_web::{MakeConsoleWriter, performance_layer};
+ layered
+ .with(fmt_layer.with_writer(MakeConsoleWriter))
+ .with(
+ performance_layer()
+ .with_details_from_fields(tracing_subscriber::fmt::format::Pretty::default()),
+ )
+ .init();
+ }
+ #[cfg(not(target_arch = "wasm32"))]
+ {
+ layered.with(fmt_layer).init();
+ }
+
+ tracing::info!("Starting. GIT_DESCRIBE = [{GIT_DESCRIBE}]");
+}
+#[event(start)]
+fn start() {
+ inner_start()
+}
+
+#[event(fetch)]
+async fn fetch(req: worker::Request, env: Env, _ctx: Context) -> Result<worker::Response> {
+ use crate::cf_worker::router;
+ router(env, req).await
+}
diff --git a/rust/sync-service/src/metrics.rs b/rust/sync-service/src/metrics.rs
new file mode 100644
index 0000000000..1b817c8e4a
--- /dev/null
+++ b/rust/sync-service/src/metrics.rs
@@ -0,0 +1,40 @@
+#[macro_export]
+macro_rules! timeit {
+ ($code:expr) => {{
+ let start = web_time::Instant::now();
+ let out = { $code };
+ (out, start.elapsed())
+ }};
+}
+
+#[macro_export]
+macro_rules! timeit_log {
+ ($code:expr) => {{ $crate::timeit_log!($code, ::tracing::debug) }};
+ ($code:expr, $logger:path) => {{
+ let (result, duration) = $crate::timeit!($code);
+ $logger!(duration_ms = duration.as_millis());
+ result
+ }};
+ ($fmt:literal, $code:expr) => {{
+ let (result, duration) = $crate::timeit!($code);
+ ::tracing::debug!(duration_ms = duration.as_millis(), $fmt);
+ result
+ }};
+ ($fmt:literal, $code:expr, $logger:expr) => {{
+ let (result, duration) = $crate::timeit!($code);
+ $logger!(duration_ms = duration.as_millis(), $literal);
+ }};
+}
+
+#[macro_export]
+macro_rules! timeit_log_if_slow {
+ ($fmt:literal, $code:expr) => {{ $crate::timeit_log_if_slow(1, $fmt, $code) }};
+ ($max_time:literal, $fmt:literal, $code:expr) => {{
+ let (out, elapsed) = $crate::timeit!($code);
+ let ms = elapsed.as_millis();
+ if ms > $max_time {
+ tracing::debug!(duration_ms = ms, $fmt);
+ }
+ out
+ }};
+}
diff --git a/rust/sync-service/src/mutex.rs b/rust/sync-service/src/mutex.rs
new file mode 100644
index 0000000000..b9fce2be7d
--- /dev/null
+++ b/rust/sync-service/src/mutex.rs
@@ -0,0 +1,210 @@
+//! Mutex with tracking and warnings when we lock for too long.
+//! Taken from [quinn](https://github.com/quinn-rs/quinn/blob/491b8b5deb14ff5c1e4ba709b7936855e63aeef5/quinn/src/mutex.rs).
+use std::{
+ collections::VecDeque,
+ fmt::Debug,
+ ops::{Deref, DerefMut},
+ time::Duration,
+};
+use tracing::warn;
+use web_time::Instant;
+
+#[derive(Debug)]
+struct Inner<T> {
+ last_lock_owner: VecDeque<(&'static str, Duration)>,
+ value: T,
+}
+
+/// A Mutex which optionally allows to track the time a lock was held and
+/// emit warnings in case of excessive lock times
+pub(crate) struct Mutex<T> {
+ inner: std::sync::Mutex<Inner<T>>,
+}
+
+impl<T: Debug> std::fmt::Debug for Mutex<T> {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ std::fmt::Debug::fmt(&self.inner, f)
+ }
+}
+
+impl<T> Mutex<T> {
+ pub(crate) const fn new(value: T) -> Self {
+ Self {
+ inner: std::sync::Mutex::new(Inner {
+ last_lock_owner: VecDeque::new(),
+ value,
+ }),
+ }
+ }
+
+ /// Acquires the lock for a certain purpose
+ ///
+ /// The purpose will be recorded in the list of last lock owners
+ pub(crate) fn lock(&self, purpose: &'static str) -> MutexGuard<'_, T> {
+ // We don't bother dispatching through Runtime::now because they're pure performance
+ // diagnostics.
+ let now = Instant::now();
+ let guard = self.inner.lock().unwrap();
+
+ let lock_time = Instant::now();
+ let elapsed = lock_time.duration_since(now);
+
+ if elapsed > Duration::from_millis(1) {
+ warn!(
+ "Locking the connection for {} took {:?}. Last owners: {:?}",
+ purpose, elapsed, guard.last_lock_owner
+ );
+ }
+
+ MutexGuard {
+ guard,
+ start_time: lock_time,
+ purpose,
+ }
+ }
+}
+
+pub(crate) struct MutexGuard<'a, T> {
+ guard: std::sync::MutexGuard<'a, Inner<T>>,
+ start_time: Instant,
+ purpose: &'static str,
+}
+
+impl<T> Drop for MutexGuard<'_, T> {
+ fn drop(&mut self) {
+ if self.guard.last_lock_owner.len() == MAX_LOCK_OWNERS {
+ self.guard.last_lock_owner.pop_back();
+ }
+
+ let duration = self.start_time.elapsed();
+
+ if duration > Duration::from_millis(1) {
+ warn!(
+ "Utilizing the connection for {} took {:?}",
+ self.purpose, duration
+ );
+ }
+
+ self.guard
+ .last_lock_owner
+ .push_front((self.purpose, duration));
+ }
+}
+
+impl<T> Deref for MutexGuard<'_, T> {
+ type Target = T;
+
+ fn deref(&self) -> &Self::Target {
+ &self.guard.value
+ }
+}
+
+impl<T> DerefMut for MutexGuard<'_, T> {
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.guard.value
+ }
+}
+
+impl<'a, T> MutexGuard<'a, T> {
+ #[cfg(test)]
+ fn last_owners(&self) -> &VecDeque<(&'static str, Duration)> {
+ &self.guard.last_lock_owner
+ }
+}
+
+const MAX_LOCK_OWNERS: usize = 20;
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_mutex_creation() {
+ let mutex = Mutex::new(42);
+ let guard = mutex.lock("test");
+ assert_eq!(*guard, 42);
+ }
+
+ #[test]
+ fn test_mutex_mutation() {
+ let mutex = Mutex::new(0);
+ {
+ let mut guard = mutex.lock("increment");
+ *guard += 1;
+ }
+ let guard = mutex.lock("read");
+ assert_eq!(*guard, 1);
+ }
+
+ #[test]
+ fn test_lock_tracking_single() {
+ let mutex: Mutex<String> = Mutex::new(String::new());
+
+ {
+ let _guard = mutex.lock("operation_1");
+ // Guard is dropped here
+ }
+
+ // Check that lock was recorded
+ let guard = mutex.lock("operation_2");
+ let owners = guard.last_owners();
+ assert_eq!(owners.len(), 1);
+ assert_eq!(owners[0].0, "operation_1");
+ }
+
+ #[test]
+ fn test_lock_tracking_multiple() {
+ let mutex: Mutex<i32> = Mutex::new(0);
+
+ for i in 0..5 {
+ let purpose = ["op1", "op2", "op3", "op4", "op5"][i];
+ let _guard = mutex.lock(purpose);
+ // Guard is dropped
+ }
+
+ let guard = mutex.lock("final");
+ let owners = guard.last_owners();
+ // Should have 5 entries in reverse order (most recent first)
+ assert_eq!(owners.len(), 5);
+ assert_eq!(owners[0].0, "op5");
+ assert_eq!(owners[4].0, "op1");
+ }
+
+ #[test]
+ fn test_max_lock_owners_limit() {
+ let mutex: Mutex<()> = Mutex::new(());
+
+ // Acquire lock MAX_LOCK_OWNERS + 5 times
+ for i in 0..(MAX_LOCK_OWNERS + 5) {
+ let purpose = Box::leak(format!("op_{}", i).into_boxed_str());
+ let _guard = mutex.lock(purpose);
+ }
+
+ let guard = mutex.lock("final");
+ let owners = guard.last_owners();
+ // Should only have MAX_LOCK_OWNERS entries, not more
+ assert_eq!(owners.len(), MAX_LOCK_OWNERS);
+ // Most recent should be op_24 (which is MAX_LOCK_OWNERS + 4)
+ assert_eq!(owners[0].0, "op_24");
+ }
+
+ #[test]
+ fn test_lock_guard_deref() {
+ let mutex = Mutex::new(vec![1, 2, 3]);
+ let guard = mutex.lock("read");
+ assert_eq!(guard.len(), 3);
+ assert_eq!(guard[0], 1);
+ }
+
+ #[test]
+ fn test_lock_guard_deref_mut() {
+ let mutex = Mutex::new(vec![1, 2, 3]);
+ {
+ let mut guard = mutex.lock("modify");
+ guard.push(4);
+ }
+ let guard = mutex.lock("verify");
+ assert_eq!(guard.len(), 4);
+ assert_eq!(guard[3], 4);
+ }
+}
diff --git a/rust/sync-service/src/secrets.rs b/rust/sync-service/src/secrets.rs
new file mode 100644
index 0000000000..54bdf97f22
--- /dev/null
+++ b/rust/sync-service/src/secrets.rs
@@ -0,0 +1,36 @@
+use worker::Env;
+
+#[derive(Clone, Debug)]
+pub struct Secrets {
+ pub internal_api_secret: String,
+ pub document_permissions_secret: String,
+}
+
+impl From<&Env> for Secrets {
+ fn from(env: &Env) -> Self {
+ // NOTE: "INTERNAL_API_SECRET_KEY" actually points to the name of the secret binding that we want to use,
+ // rather than the key itself. This might want to be changed in the future.
+ let secret_binding = env
+ .var("INTERNAL_API_SECRET_KEY")
+ .unwrap_or_else(|e| {
+ panic!("Couldn't get INTERNAL_API_SECRET_KEY environment variable: {e}")
+ })
+ .to_string();
+
+ let internal_api_secret = env
+ .secret(&secret_binding)
+ .unwrap_or_else(|_e| panic!("Couldn't get secret secret for internal API key"))
+ .to_string();
+ let document_permissions_secret = env
+ .var("DOCUMENT_PERMISSIONS_SECRET")
+ .unwrap_or_else(|e| {
+ panic!("Couldn't get INTERNAL_API_SECRET_KEY environment variable: {e}")
+ })
+ .to_string();
+
+ Self {
+ internal_api_secret,
+ document_permissions_secret,
+ }
+ }
+}
diff --git a/rust/sync-service/src/sps.rs b/rust/sync-service/src/sps.rs
new file mode 100644
index 0000000000..49516a56a7
--- /dev/null
+++ b/rust/sync-service/src/sps.rs
@@ -0,0 +1,45 @@
+use crate::constants::header_names::MACRO_INTERNAL_AUTH_KEY_HEADER_KEY;
+use serde_json::json;
+use tracing::{debug, error};
+use worker::{Fetch, Method, Request, RequestInit};
+
+pub async fn update(document_id: &str, env: &worker::Env) -> worker::Result<()> {
+ let internal_auth_key = env
+ .secret("SPS_API_SECRET_KEY")
+ .inspect_err(|e| error!(error=%e, "Could not find API SPS key binding"))?
+ .to_string();
+ let url = env
+ .var("SPS_URL")
+ .inspect_err(|e| error!(error=%e, "Could not find SPS URL binding"))?
+ .to_string();
+
+ let url = format!("{url}/internal/extract_sync");
+ let json_body = json!({
+ "documents": [{
+ "document_id": document_id,
+ "file_type": "md",
+ }]
+ });
+
+ let mut request = Request::new_with_init(
+ &url,
+ RequestInit::new()
+ .with_method(Method::Post)
+ .with_body(Some(json_body.to_string().into())),
+ )?;
+
+ let headers = request.headers_mut()?;
+ headers.set("Content-Type", "application/json")?;
+ headers.set(MACRO_INTERNAL_AUTH_KEY_HEADER_KEY, &internal_auth_key)?;
+
+ let mut response = Fetch::Request(request).send().await?;
+ if response.status_code() != 200 {
+ error!("non-200 response from sps");
+ match response.text().await {
+ Ok(body) => error!("non-200 response body:\n{body}"),
+ Err(e) => error!("couldn't read non-200 response body to string. Error: {e:?}"),
+ }
+ }
+ debug!("finished sending search index update");
+ Ok(())
+}
diff --git a/rust/sync-service/src/state.rs b/rust/sync-service/src/state.rs
new file mode 100644
index 0000000000..343318bb7d
--- /dev/null
+++ b/rust/sync-service/src/state.rs
@@ -0,0 +1,261 @@
+use std::{borrow::Cow, sync::Mutex};
+
+use loro::{ExportMode, Frontiers, LoroDoc, ToJson};
+use tracing::debug;
+use web_time::Instant;
+use worker::Result;
+
+use crate::error::ResultExt;
+
+const FROM_CLIENT_TAG: &str = "from_client";
+const FROM_SERVICE_TAG: &str = "from_service";
+const FRONTIERS_ID_SEPERATOR: &str = "|";
+
+#[derive(Debug)]
+pub struct DocumentState {
+ pub loro_doc: LoroDoc,
+ pub last_update: Mutex<Option<Instant>>,
+ pub last_export: Mutex<Option<Instant>>,
+}
+
+impl DocumentState {
+ pub fn new() -> Self {
+ Self {
+ loro_doc: LoroDoc::new(),
+ last_update: Mutex::new(None),
+ last_export: Mutex::new(None),
+ }
+ }
+
+ /// Initialize the document state from a snapshot
+ pub fn try_from_snapshot(snapshot: &[u8]) -> Result<Self> {
+ let loro_doc = LoroDoc::new();
+ let status = loro_doc
+ .import_with(snapshot, FROM_SERVICE_TAG)
+ .context("failed to import snapshot")?;
+
+ let (sf, of) = (loro_doc.state_frontiers(), loro_doc.state_frontiers());
+ debug!(state_frontiers =? sf, oplog_frontiers =? of,"loaded new DocumentState");
+ if status.pending.is_some() {
+ return Err(worker::Error::from("failed to import snapshot"));
+ }
+
+ Ok(Self {
+ loro_doc,
+ last_update: Mutex::new(None),
+ last_export: Mutex::new(None),
+ })
+ }
+
+ /// Get: `(state_frontiers, oplog_frotiers)`
+ pub fn frontiers(&self) -> (Frontiers, Frontiers) {
+ (
+ self.loro_doc.state_frontiers(),
+ self.loro_doc.oplog_frontiers(),
+ )
+ }
+
+ pub fn get_json(&self) -> String {
+ self.loro_doc.get_deep_value().to_json()
+ }
+ pub fn should_save(&self) -> bool {
+ let Some(up) = *self
+ .last_update
+ .lock()
+ .unwrap_context("last_update mutex poisoned")
+ else {
+ return false;
+ };
+ match *self
+ .last_export
+ .lock()
+ .unwrap_context("last_export mutex poisoned")
+ {
+ Some(exp) => up > exp,
+ None => true,
+ }
+ }
+
+ pub fn mark_exported(&self) {
+ *self
+ .last_export
+ .lock()
+ .unwrap_context("last_export mutex poisoned") = Some(Instant::now());
+ }
+
+ /// Import a new update into the document state
+ pub fn import(&self, update: &[u8]) -> Result<()> {
+ self.loro_doc
+ .import_with(update, FROM_CLIENT_TAG)
+ .context("failed to import update")?;
+ *self
+ .last_update
+ .lock()
+ .unwrap_context("last_update mutex poisoned") = Some(Instant::now());
+
+ Ok(())
+ }
+
+ /// Export the document state as a snapshot
+ pub fn export_snapshot(&self, export_mode: Option<ExportMode>) -> Result<Vec<u8>> {
+ let export_mode = export_mode.unwrap_or(ExportMode::Snapshot);
+ self.loro_doc
+ .export(export_mode)
+ .context("failed to export snapshot")
+ }
+
+ pub fn export_shallow_snapshot(&self) -> Result<Vec<u8>> {
+ self.loro_doc
+ .export(ExportMode::ShallowSnapshot(Cow::Borrowed(
+ &self.loro_doc.state_frontiers(),
+ )))
+ .context("failed to export snapshot")
+ }
+ pub fn version_id(&self) -> String {
+ self.loro_doc
+ .state_frontiers()
+ .iter()
+ .map(|id| id.to_string())
+ .collect::<Vec<_>>()
+ .join(FRONTIERS_ID_SEPERATOR)
+ }
+
+ pub fn export_updates_since(&self, frontiers: &Frontiers) -> Result<Vec<u8>> {
+ let version_vector = self
+ .loro_doc
+ .frontiers_to_vv(frontiers)
+ .ok_or_else(|| worker::Error::from("failed to convert frontiers to version vector"))?;
+
+ self.loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&version_vector),
+ })
+ .context("failed to export updates")
+ }
+
+ /// Batch import a list of pending operations/updates into the document state
+ pub fn replay_pending_operations(&self, updates: &[Vec<u8>]) -> Result<()> {
+ self.loro_doc
+ .import_batch(updates)
+ .context("failed to batch import pending updates")?;
+
+ Ok(())
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_import_snapshot() {
+ let loro_doc = LoroDoc::new();
+ let text = loro_doc.get_text("content");
+ text.push_str("hello world").unwrap();
+ let snapshot = loro_doc.export(ExportMode::Snapshot).unwrap();
+ let state = DocumentState::try_from_snapshot(snapshot.as_slice()).unwrap();
+ let text = state.loro_doc.get_text("content");
+ assert_eq!(text.to_string(), "hello world");
+ }
+
+ #[test]
+ fn test_import_update() {
+ let loro_doc = LoroDoc::new();
+ let text = loro_doc.get_text("content");
+ text.push_str("01").unwrap();
+
+ let initial_snapshot = loro_doc.export(ExportMode::Snapshot).unwrap();
+
+ let state = DocumentState::try_from_snapshot(initial_snapshot.as_slice()).unwrap();
+
+ let state_vv = loro_doc.state_vv();
+ text.push_str("234").unwrap();
+
+ let update = loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&state_vv),
+ })
+ .unwrap();
+
+ state.import(update.as_slice()).unwrap();
+
+ let text = state.loro_doc.get_text("content");
+ assert_eq!(text.to_string(), "01234");
+ }
+
+ #[test]
+ fn test_should_save() {
+ let loro_doc = LoroDoc::new();
+ let text = loro_doc.get_text("content");
+ text.push_str("012").unwrap();
+
+ let initial_snapshot = loro_doc.export(ExportMode::Snapshot).unwrap();
+
+ let state = DocumentState::try_from_snapshot(initial_snapshot.as_slice()).unwrap();
+ assert!(!state.should_save());
+
+ let state_vv = loro_doc.state_vv();
+ text.push_str("234").unwrap();
+
+ let update = loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&state_vv),
+ })
+ .unwrap();
+
+ state.import(update.as_slice()).unwrap();
+
+ assert!(state.should_save());
+ // do export here
+ state.mark_exported();
+ assert!(!state.should_save());
+ }
+
+ #[test]
+ fn test_replay_pending_operations() {
+ let loro_doc = LoroDoc::new();
+ let text = loro_doc.get_text("content");
+ text.push_str("012").unwrap();
+
+ let initial_snapshot = loro_doc.export(ExportMode::Snapshot).unwrap();
+
+ let state = DocumentState::try_from_snapshot(initial_snapshot.as_slice()).unwrap();
+
+ let mut updates = vec![];
+
+ let version_vector = loro_doc.state_vv();
+ text.push_str("3").unwrap();
+ updates.push(
+ loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&version_vector),
+ })
+ .unwrap(),
+ );
+
+ text.push_str("4").unwrap();
+ updates.push(
+ loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&version_vector),
+ })
+ .unwrap(),
+ );
+
+ text.push_str("5").unwrap();
+ let update5 = loro_doc
+ .export(ExportMode::Updates {
+ from: std::borrow::Cow::Borrowed(&version_vector),
+ })
+ .unwrap();
+
+ updates.push(update5.clone());
+ // Test to ensure that duplicate updates don't affect the state
+ updates.push(update5.clone());
+
+ state.replay_pending_operations(&updates).unwrap();
+
+ let text = state.loro_doc.get_text("content");
+ assert_eq!(text.to_string(), "012345");
+ }
+}
diff --git a/rust/sync-service/src/storage/backends/combined_sql_kv.rs b/rust/sync-service/src/storage/backends/combined_sql_kv.rs
new file mode 100644
index 0000000000..32a3ea0666
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/combined_sql_kv.rs
@@ -0,0 +1,37 @@
+use worker::Env;
+
+use crate::storage::snapshot::SnapshotStorage;
+
+use super::{durable_sql::DurableSQLStorage, kv::Kv};
+
+pub struct Storage {
+ sql: DurableSQLStorage,
+ kv: Kv,
+}
+
+impl Storage {
+ pub fn new(env: &Env, storage: worker::Storage, document_id: String) -> worker::Result<Self> {
+ Ok(Self {
+ sql: DurableSQLStorage::new(storage, document_id.clone())?,
+ kv: Kv::from_env(env, document_id)?,
+ })
+ }
+}
+
+impl SnapshotStorage for Storage {
+ async fn store_snapshot(&self, snapshot: &[u8]) -> worker::Result<()> {
+ self.sql.store_snapshot(snapshot).await
+ }
+
+ async fn get_snapshot(&self) -> worker::Result<Vec<u8>> {
+ if self.sql.has_snapshot().await? {
+ self.sql.get_snapshot().await
+ } else {
+ self.kv.get_snapshot().await
+ }
+ }
+
+ async fn has_snapshot(&self) -> worker::Result<bool> {
+ Ok(self.sql.has_snapshot().await? || self.kv.has_snapshot().await?)
+ }
+}
diff --git a/rust/sync-service/src/storage/backends/durable_kv.rs b/rust/sync-service/src/storage/backends/durable_kv.rs
new file mode 100644
index 0000000000..5480bfdae5
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/durable_kv.rs
@@ -0,0 +1,272 @@
+use loro::VersionVector;
+use std::{
+ collections::BTreeSet,
+ sync::{
+ RwLock,
+ atomic::{AtomicUsize, Ordering},
+ },
+};
+use tracing::{error, trace, warn};
+use web_time::SystemTime;
+use worker::{
+ ListOptions, Result, Storage,
+ js_sys::{self, Reflect},
+ wasm_bindgen::JsCast,
+};
+
+use crate::{durable_object::NO_SUCH_VALUE_ERR_STR, error::ResultExt, state::DocumentState};
+
+/// When saving snapshot, we also write the version vector to durable object KV
+/// When we read a snapshot from Worker KV, we check it's version vector is >= version vector in LAST_VERSION_VECTOR.
+const LAST_VERSION_VECTOR_KEY: &str = "LAST_VERSION_VECTOR";
+
+pub struct DurableKVStorage {
+ inner: Storage,
+ ids: OrederedIds,
+ applied_keys: RwLock<BTreeSet<String>>,
+}
+
+/// For a given op, if it has been applied but the snapshot has not be saved, it is considered
+/// 'pending'
+const PENDING_OP_PREFIX: &str = "o/";
+/// This prefix has a record of all ops. We keep all ops because we have been losing data.
+/// NB: This does not contain all historical ops, just ops since we started tracking. So it can't
+/// be used to recreate all documents.
+const ALL_OP_PREFIX: &str = "a/";
+
+fn pending_op_key(id: &str) -> String {
+ format!("{PENDING_OP_PREFIX}{id}")
+}
+fn all_op_key(id: &str) -> String {
+ format!("{ALL_OP_PREFIX}{id}")
+}
+
+fn do_kv_result_to_result_opt<T>(res: Result<T>) -> Result<Option<T>> {
+ match res {
+ Ok(x) => Ok(Some(x)),
+ Err(worker::Error::JsError(s)) => {
+ if s.contains(NO_SUCH_VALUE_ERR_STR) {
+ Ok(None)
+ } else {
+ Err(worker::Error::JsError(s))
+ }
+ }
+ Err(e) => Err(e),
+ }
+}
+
+impl DurableKVStorage {
+ pub fn new(inner: Storage) -> Self {
+ Self {
+ inner,
+ ids: OrederedIds::default(),
+ applied_keys: Default::default(),
+ }
+ }
+
+ pub(in crate::storage) async fn get_key(&self, key: &str) -> Result<Option<Vec<u8>>> {
+ do_kv_result_to_result_opt(self.inner.get(key).await)
+ }
+
+ pub(in crate::storage) async fn list_do_kv(
+ &self,
+ prefix: &str,
+ ) -> Result<Vec<Result<(String, Vec<u8>)>>> {
+ Ok(self
+ .inner
+ .list_with_options(ListOptions::new().prefix(prefix))
+ .await?
+ .entries()
+ .into_iter()
+ .map(|res| {
+ let entry = res.context("Error getting entry")?;
+ let key: String = Reflect::get_u32(&entry, 0)
+ .context("failed to get key")?
+ .as_string()
+ .context("Key is not a string")?;
+
+ let value = Reflect::get_u32(&entry, 1).context("failed to get value")?;
+
+ let bytes = if value.is_instance_of::<js_sys::Uint8Array>() {
+ js_sys::Uint8Array::unchecked_from_js_ref(&value).to_vec()
+ } else {
+ js_sys::Uint8Array::new(&value).to_vec()
+ };
+
+ Ok((key, bytes))
+ })
+ .collect())
+ }
+
+ /// get pending operations from the operation log
+ pub(crate) async fn get_pending_operations(&self) -> Result<Vec<Result<(String, Vec<u8>)>>> {
+ self.list_do_kv(PENDING_OP_PREFIX).await
+ }
+
+ pub async fn apply_op(&self, document_state: &DocumentState, op_update: &[u8]) -> Result<()> {
+ let op_id = self.ids.id();
+ let op_key = pending_op_key(&op_id);
+ document_state.import(op_update)?;
+ self.inner.put(&op_key, op_update).await?;
+ self.applied_keys
+ .write()
+ .unwrap_context("applied_keys mutex poisoned")
+ .insert(op_key);
+ self.inner.put(&all_op_key(&op_id), op_update).await?;
+ Ok(())
+ }
+
+ pub async fn apply_pending_ops(&self, snapshot: &DocumentState) -> Result<()> {
+ let pending_ops = self
+ .get_pending_operations()
+ .await
+ .context("get_pending_operations failed")?;
+ let n_pending_ops = pending_ops.len();
+ trace!(
+ pending_ops_len = n_pending_ops,
+ "Applying [{}] pending ops", n_pending_ops
+ );
+
+ let mut ers = vec![];
+ let mut ops = vec![];
+ let mut keys = vec![];
+ for res_op in pending_ops {
+ match res_op {
+ Ok((k, o)) => {
+ keys.push(k);
+ ops.push(o);
+ }
+ Err(e) => ers.push(e),
+ }
+ }
+
+ if !ers.is_empty() {
+ error!(errors =? ers, "got [{}] invalid things from durable ojbect KV", ers.len());
+ }
+
+ snapshot
+ .replay_pending_operations(&ops)
+ .context("failed applying pending ops")?;
+
+ self.applied_keys
+ .write()
+ .unwrap_context("applied_keys mutex poisoned")
+ .extend(keys);
+
+ Ok(())
+ }
+
+ pub async fn clear_applied_ops(&self) -> Result<()> {
+ let keys: Vec<String> = {
+ let keys = self
+ .applied_keys
+ .read()
+ .unwrap_context("applied_keys mutex poisoned");
+ if keys.is_empty() {
+ return Ok(());
+ }
+ keys.clone().into_iter().collect()
+ };
+ let n_deleted = self
+ .inner
+ .delete_multiple(keys.clone())
+ .await
+ .inspect_err(|e| warn!(keys =? keys, error=?e, "error in kv.delete_multiple()"))?;
+ if n_deleted != keys.len() {
+ error!(
+ n_deleted = n_deleted,
+ keys_len = keys.len(),
+ keys =? keys,
+ "
+We have mystery key which we can't delete.
+We must cycle through current keys and remove those we have not applied yet
+TODO
+"
+ );
+ }
+ let mut app_keys = self
+ .applied_keys
+ .write()
+ .unwrap_context("applied_keys mutex poisoned");
+ for k in keys {
+ app_keys.remove(&k);
+ }
+ Ok(())
+ }
+
+ pub async fn store_version_vector(&self, vv: &VersionVector) -> Result<()> {
+ let value = vv.encode();
+ self.inner.put(LAST_VERSION_VECTOR_KEY, value).await?;
+ Ok(())
+ }
+
+ /// The passed in version vector should be equal or greater than the last saved vv
+ pub async fn cmp_vv_with_last_snapshot_vv(
+ &self,
+ loaded_snapshot_vv: &VersionVector,
+ ) -> Result<()> {
+ let Some(bytes) =
+ do_kv_result_to_result_opt(self.inner.get::<Vec<u8>>(LAST_VERSION_VECTOR_KEY).await)?
+ else {
+ warn!("No version vector was saved the last time a snapshot was saved");
+ return Ok(());
+ };
+ let last_saved_vv = VersionVector::decode(&bytes).expect("TODO we wrote a bad vv???");
+ match loaded_snapshot_vv.partial_cmp(&last_saved_vv) {
+ Some(ord) => match ord {
+ std::cmp::Ordering::Less => {
+ error!("Loaded snapshot older than the last snapshot saved");
+ }
+ std::cmp::Ordering::Equal => {
+ trace!("Loaded snapshot matches last snapshot saved");
+ }
+ std::cmp::Ordering::Greater => {
+ // this could happen if saving snapshot succeeds but writing, but
+ // store_version_vector fails.
+ warn!("Loaded snapshot was newer than the last snapshot saved");
+ }
+ },
+ None => {
+ warn!("Loaded snapshot that diverged from the last snapshot saved");
+ }
+ }
+ Ok(())
+ }
+}
+
+/// Produce ID's that are orderable lexicalgraphically in the order they were created.
+#[derive(Debug, Default)]
+pub struct OrederedIds {
+ counter: AtomicUsize,
+}
+
+impl OrederedIds {
+ const ORDERING: Ordering = Ordering::Relaxed;
+
+ pub fn id(&self) -> String {
+ let ts = SystemTime::now()
+ .duration_since(SystemTime::UNIX_EPOCH)
+ .unwrap_context("Time since unix epoch was negative...?")
+ .as_nanos();
+ let i = self.counter.fetch_add(1, Self::ORDERING);
+ format!("{ts:016x}.{i:08x}")
+ }
+}
+
+#[cfg(test)]
+mod test {
+ use super::*;
+
+ #[test]
+ fn order_timestamps() -> std::result::Result<(), Box<dyn std::error::Error>> {
+ let x = OrederedIds::default();
+ let mut og_arr = vec![];
+ for _ in 0..10 {
+ og_arr.push(x.id());
+ }
+ let mut sorted_arr = og_arr.clone();
+ sorted_arr.sort();
+ assert_eq!(sorted_arr, og_arr);
+ Ok(())
+ }
+}
diff --git a/rust/sync-service/src/storage/backends/durable_sql.rs b/rust/sync-service/src/storage/backends/durable_sql.rs
new file mode 100644
index 0000000000..47285bc187
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/durable_sql.rs
@@ -0,0 +1,225 @@
+use tracing::trace;
+use worker::{Error, Result, SqlStorage, SqlStorageValue, Storage};
+
+use crate::{storage::snapshot::SnapshotStorage, timeit};
+
+/// Chunked key-value storage backend using Durable Object SQL storage.
+/// Automatically chunks values larger than CHUNK_SIZE to work within SQLite limits.
+pub struct DurableSQLStorage {
+ document_id: String,
+ storage: Storage,
+}
+
+/// Maximum size per chunk (1.5 MB)
+const CHUNK_SIZE: usize = 1_572_864; // 1.5 * 1024 * 1024
+
+impl DurableSQLStorage {
+ pub fn new(storage: Storage, document_id: String) -> Result<Self> {
+ storage.sql().exec(
+ "CREATE TABLE IF NOT EXISTS kv_store (
+ id TEXT NOT NULL,
+ chunk INTEGER NOT NULL,
+ data BLOB,
+ PRIMARY KEY (id, chunk)
+ )",
+ None,
+ )?;
+ Ok(Self {
+ document_id,
+ storage,
+ })
+ }
+
+ /// Store a key-value pair, chunking large values automatically
+ pub fn put(&self, key: &str, value: &[u8]) -> Result<()> {
+ // I broke this out bc I'm trying to figure out how to wrap it in a transaction
+ fn put_impl(sql: &SqlStorage, key: &str, value: &[u8]) -> Result<()> {
+ sql.exec(
+ "DELETE FROM kv_store WHERE id = ?1",
+ Some(vec![SqlStorageValue::from(key)]),
+ )?;
+
+ // If value is empty, we're done (effectively a delete)
+ if value.is_empty() {
+ return Ok(());
+ }
+
+ let chunks: Vec<&[u8]> = value.chunks(CHUNK_SIZE).collect();
+
+ for (chunk_num, chunk_data) in chunks.iter().enumerate() {
+ sql.exec(
+ "INSERT INTO kv_store (id, chunk, data) VALUES (?1, ?2, ?3)",
+ Some(vec![
+ SqlStorageValue::from(key),
+ SqlStorageValue::from(chunk_num as i64),
+ SqlStorageValue::from(chunk_data.to_vec()),
+ ]),
+ )?;
+ }
+
+ Ok(())
+ }
+
+ put_impl(&self.storage.sql(), key, value)
+ }
+
+ /// Retrieve a value by key, reassembling chunks if necessary
+ pub fn get(&self, key: &str) -> Result<Option<Vec<u8>>> {
+ let cursor = self.storage.sql().exec(
+ "SELECT chunk, data FROM kv_store WHERE id = ?1 ORDER BY chunk",
+ Some(vec![SqlStorageValue::from(key)]),
+ )?;
+
+ // Reassemble chunks in order
+ let mut reassembled = Vec::new();
+ let mut expected_chunk = 0i64;
+
+ for row in cursor.raw() {
+ let (chunk, data) = chunk_data_from_row(row?)?;
+ if chunk != expected_chunk {
+ return Err(worker::Error::from(format!(
+ "Missing chunk #[{expected_chunk}] for key [{key}]. Got chunk #[{chunk}]"
+ )));
+ }
+ reassembled.extend_from_slice(&data);
+ expected_chunk += 1;
+ }
+ if expected_chunk == 0 {
+ return Ok(None);
+ }
+
+ Ok(Some(reassembled))
+ }
+
+ /// Check if a key exists
+ pub fn exists(&self, key: &str) -> Result<bool> {
+ let cursor = self.storage.sql().exec(
+ "SELECT 1 FROM kv_store WHERE id = ?1 LIMIT 1",
+ Some(vec![SqlStorageValue::from(key)]),
+ )?;
+
+ let results: Vec<serde_json::Value> = cursor.to_array()?;
+ Ok(!results.is_empty())
+ }
+
+ /// Delete a key and all its chunks
+ #[expect(unused, reason = "We could use this in place of DO KV")]
+ pub fn delete(&self, key: &str) -> Result<bool> {
+ let cursor = self.storage.sql().exec(
+ "DELETE FROM kv_store WHERE id = ?1",
+ Some(vec![SqlStorageValue::from(key)]),
+ )?;
+
+ Ok(cursor.rows_written() > 0)
+ }
+
+ /// List all keys in the storage
+ #[expect(unused, reason = "We could use this in place of DO KV")]
+ pub fn list_keys(&self) -> Result<Vec<String>> {
+ let cursor = self
+ .storage
+ .sql()
+ .exec("SELECT DISTINCT id FROM kv_store ORDER BY id", None)?;
+
+ let results: Vec<serde_json::Value> = cursor.to_array()?;
+ let mut keys = Vec::new();
+
+ for row in results {
+ if let Some(key) = row.get("id").and_then(|v| v.as_str()) {
+ keys.push(key.to_string());
+ }
+ }
+
+ Ok(keys)
+ }
+
+ /// Get storage statistics
+ #[expect(unused, reason = "For debugging")]
+ pub fn stats(&self) -> Result<StorageStats> {
+ let cursor = self.storage.sql().exec(
+ "SELECT COUNT(DISTINCT id) as key_count, COUNT(*) as chunk_count, SUM(LENGTH(data)) as total_size FROM kv_store",
+ None
+ )?;
+
+ let results: Vec<serde_json::Value> = cursor.to_array()?;
+
+ if let Some(row) = results.first() {
+ let key_count = row
+ .get("key_count")
+ .and_then(|v| v.as_i64())
+ .map(|f| f as u64)
+ .unwrap_or(0);
+
+ let chunk_count = row
+ .get("chunk_count")
+ .and_then(|v| v.as_i64())
+ .map(|f| f as u64)
+ .unwrap_or(0);
+
+ let total_size = row
+ .get("total_size")
+ .and_then(|v| v.as_i64())
+ .map(|f| f as u64)
+ .unwrap_or(0);
+
+ Ok(StorageStats {
+ key_count,
+ chunk_count,
+ total_size,
+ })
+ } else {
+ Ok(StorageStats::default())
+ }
+ }
+}
+
+#[expect(unused, reason = "For debugging")]
+#[derive(Debug, Default)]
+pub struct StorageStats {
+ pub key_count: u64,
+ pub chunk_count: u64,
+ pub total_size: u64,
+}
+
+impl SnapshotStorage for DurableSQLStorage {
+ /// Stores a snapshot in the storage
+ async fn store_snapshot(&self, snapshot: &[u8]) -> worker::Result<()> {
+ self.put(&self.document_id, snapshot)
+ }
+ /// Retrieves a snpashot from the storage
+ async fn get_snapshot(&self) -> worker::Result<Vec<u8>> {
+ let (res, elapsed) = timeit!(self.get(&self.document_id));
+ match res {
+ Ok(Some(x)) => {
+ trace!(
+ duration_ms = elapsed.as_millis(),
+ document_id = self.document_id,
+ snapshot_size = x.len(),
+ "do_sql::get_snapshot"
+ );
+ Ok(x)
+ }
+ Ok(None) => Err(Error::from(format!(
+ "No snapshot for document_id = [{}]",
+ self.document_id
+ ))),
+ Err(e) => Err(e)?,
+ }
+ }
+ /// Checks if a snapshot exists in the storage
+ async fn has_snapshot(&self) -> worker::Result<bool> {
+ self.exists(&self.document_id)
+ }
+}
+
+fn chunk_data_from_row(row: Vec<SqlStorageValue>) -> Result<(i64, Vec<u8>)> {
+ let mut row = row.into_iter();
+ let Some(SqlStorageValue::Integer(chunk)) = row.next() else {
+ todo!()
+ };
+ let Some(SqlStorageValue::Blob(data)) = row.next() else {
+ todo!()
+ };
+ debug_assert!(row.next().is_none());
+ Ok((chunk, data))
+}
diff --git a/rust/sync-service/src/storage/backends/kv.rs b/rust/sync-service/src/storage/backends/kv.rs
new file mode 100644
index 0000000000..1033e45062
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/kv.rs
@@ -0,0 +1,77 @@
+use tracing::trace;
+use worker::{
+ Env, Error,
+ kv::{KvError, KvStore},
+};
+
+use crate::{error::ResultExt, storage::snapshot::SnapshotStorage, timeit};
+
+pub const SNAPSHOT_STORE_KV_BINDING: &str = "SNAPSHOT_STORE_KV";
+
+pub struct Kv {
+ document_id: String,
+ inner: KvStore,
+}
+impl Kv {
+ pub fn from_env(env: &Env, document_id: String) -> worker::Result<Self> {
+ let ss_kv = env
+ .kv(SNAPSHOT_STORE_KV_BINDING)
+ .context("Colud not get env SNAPSHOT_STORE_KV_BINDING")?;
+ Ok(Self::new(ss_kv, document_id))
+ }
+ pub fn new(inner: KvStore, document_id: String) -> Self {
+ Self { inner, document_id }
+ }
+ pub async fn get(&self, name: &str) -> Result<Option<Vec<u8>>, KvError> {
+ self.inner.get(name).bytes().await
+ }
+ pub async fn put(&self, name: &str, value: &[u8]) -> Result<(), KvError> {
+ self.inner.put_bytes(name, value)?.execute().await
+ }
+}
+
+impl SnapshotStorage for Kv {
+ async fn store_snapshot(&self, snapshot: &[u8]) -> worker::Result<()> {
+ let key = format!("{}/{}.snapshot", self.document_id, self.document_id);
+ crate::timeout_ez!(self.put(&key, snapshot))
+ .with_context(|| format!("failed to store snapshot: {key}"))
+ }
+
+ async fn get_snapshot(&self) -> worker::Result<Vec<u8>> {
+ let key = format!("{}/{}.snapshot", self.document_id, self.document_id);
+ let (Some(snapshot), elapsed) = timeit!(
+ crate::timeout_ez!(self.get(&key))
+ .with_context(|| format!("Couldn't get snapshot with key: [{key}]"))?
+ ) else {
+ return Err(Error::from(format!(
+ "worker kv: no snapshot with key: [{key}]"
+ )));
+ };
+ trace!(
+ duration_ms = elapsed.as_millis(),
+ document_id = self.document_id,
+ snapshot_size = snapshot.len(),
+ "kv::get_snapshot"
+ );
+ Ok(snapshot)
+ }
+
+ #[tracing::instrument(skip_all, ret)]
+ async fn has_snapshot(&self) -> worker::Result<bool> {
+ Ok(!crate::timeout_ez!(
+ self.inner
+ .list()
+ .prefix(self.document_id.clone())
+ .limit(1)
+ .execute()
+ )
+ .with_context(|| {
+ format!(
+ "failed check if snapshot exists. document_id: {}",
+ self.document_id
+ )
+ })?
+ .keys
+ .is_empty())
+ }
+}
diff --git a/rust/sync-service/src/storage/backends/mod.rs b/rust/sync-service/src/storage/backends/mod.rs
new file mode 100644
index 0000000000..7898658677
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/mod.rs
@@ -0,0 +1,16 @@
+pub mod durable_kv;
+#[cfg(feature = "do-sqlite-snapshot-storage")]
+pub mod durable_sql;
+
+pub mod kv;
+#[cfg(feature = "kv-snapshot-storage")]
+pub use kv::Kv as Storage;
+
+#[cfg(feature = "r2-snapshot-storage")]
+pub mod r2;
+#[cfg(feature = "r2-snapshot-storage")]
+pub use r2::R2Storage as Storage;
+
+pub mod combined_sql_kv;
+#[cfg(feature = "do-sqlite-snapshot-storage")]
+pub use combined_sql_kv::Storage;
diff --git a/rust/sync-service/src/storage/backends/r2.rs b/rust/sync-service/src/storage/backends/r2.rs
new file mode 100644
index 0000000000..443ec4c841
--- /dev/null
+++ b/rust/sync-service/src/storage/backends/r2.rs
@@ -0,0 +1,92 @@
+use tracing::trace;
+
+use crate::timeit;
+
+use super::super::snapshot::SnapshotStorage;
+use worker::Bucket;
+
+pub struct R2Storage {
+ inner: Bucket,
+ pub document_id: String,
+}
+
+impl R2Storage {
+ pub fn new(inner: Bucket, document_id: String) -> Self {
+ Self { inner, document_id }
+ }
+
+ pub async fn get<T>(&self, key: &str) -> worker::Result<T>
+ where
+ T: serde::de::DeserializeOwned,
+ {
+ let bytes = self.get_raw(key).await?;
+
+ serde_json::from_slice::<T>(&bytes)
+ .map_err(|e| worker::Error::from(format!("Deserialization error: {e}")))
+ }
+
+ pub async fn get_raw(&self, key: &str) -> worker::Result<Vec<u8>> {
+ self.inner
+ .get(key)
+ .execute()
+ .await?
+ .ok_or_else(|| worker::Error::from("response not found"))?
+ .body()
+ .ok_or_else(|| worker::Error::from("response body not found"))?
+ .bytes()
+ .await
+ }
+
+ pub async fn put<T>(&self, key: &str, value: T) -> worker::Result<()>
+ where
+ T: serde::Serialize,
+ {
+ let bytes = serde_json::to_vec(&value)
+ .map_err(|e| worker::Error::from(format!("Serialization error: {e}")))?;
+
+ self.put_raw(key, bytes).await
+ }
+
+ pub async fn put_raw(&self, key: &str, bytes: Vec<u8>) -> worker::Result<()> {
+ self.inner
+ .put(key, bytes)
+ .execute()
+ .await
+ .map(|_| ())
+ .map_err(|e| worker::Error::from(format!("failed to put key {key} in bucket: {e}")))
+ }
+
+ pub async fn has(&self, key: &str) -> worker::Result<bool> {
+ let object = self.inner.head(key).await?;
+ Ok(object.is_some())
+ }
+}
+
+impl SnapshotStorage for R2Storage {
+ async fn store_snapshot(&self, snapshot: Vec<u8>) -> worker::Result<()> {
+ let key = format!("{}/{}.snapshot", self.document_id, self.document_id);
+ self.put_raw(&key, snapshot).await?;
+
+ Ok(())
+ }
+
+ async fn get_snapshot(&self) -> worker::Result<Vec<u8>> {
+ let (snapshot, elapsed) = timeit!({
+ let key = format!("{}/{}.snapshot", self.document_id, self.document_id);
+ self.get_raw(&key).await?
+ });
+ trace!(
+ duration_ms = elapsed.as_millis(),
+ document_id = self.document_id,
+ snapshot_size = snapshot.len(),
+ "kv::get_snapshot"
+ );
+ Ok(snapshot)
+ }
+
+ async fn has_snapshot(&self) -> worker::Result<bool> {
+ let key = format!("{}/{}.snapshot", self.document_id, self.document_id);
+ let has = self.has(&key).await?;
+ Ok(has)
+ }
+}
diff --git a/rust/sync-service/src/storage/mod.rs b/rust/sync-service/src/storage/mod.rs
new file mode 100644
index 0000000000..1e97ff692d
--- /dev/null
+++ b/rust/sync-service/src/storage/mod.rs
@@ -0,0 +1,131 @@
+use backends::Storage;
+use snapshot::SnapshotStorage;
+use tracing::trace;
+use worker::{Env, Error, Result, State};
+
+use crate::{
+ state::DocumentState, storage::backends::durable_kv::DurableKVStorage, timeit, timeit_log,
+};
+
+pub mod backends;
+pub mod op_log;
+pub mod snapshot;
+
+pub struct SessionStorage {
+ snapshot_storage: Storage,
+ oplog: DurableKVStorage,
+}
+
+impl SessionStorage {
+ pub fn new(snapshot_storage: Storage, oplog: DurableKVStorage) -> Self {
+ Self {
+ snapshot_storage,
+ oplog,
+ }
+ }
+
+ /// Load document state and apply any pending ops
+ pub async fn load_document_state(&self) -> Result<DocumentState> {
+ let snapshot = self.get_snapshot().await;
+ let state = match (snapshot, cfg!(feature = "create-default-state")) {
+ (Ok(snapshot), _) => DocumentState::try_from_snapshot(snapshot.as_slice()),
+ (Err(_e), true) => {
+ let state = DocumentState::new();
+ timeit_log!("ensure_initialized new store_snapshot", {
+ self.store_snapshot(&state).await?;
+ });
+ Ok(state)
+ }
+ (Err(e), false) => {
+ return Err(Error::from(format!("document snapshot not found: {e}")));
+ }
+ }?;
+ self.oplog
+ .cmp_vv_with_last_snapshot_vv(&state.loro_doc.oplog_vv())
+ .await?;
+ self.oplog.apply_pending_ops(&state).await?;
+ Ok(state)
+ }
+
+ pub async fn get_pending_operations(&self) -> Result<Vec<Result<(String, Vec<u8>)>>> {
+ self.oplog.get_pending_operations().await
+ }
+
+ pub async fn debug_do_kv_get(&self, key: &str) -> Result<Option<Vec<u8>>> {
+ self.oplog.get_key(key).await
+ }
+
+ pub async fn debug_list_do_kv(&self, prefix: &str) -> Result<Vec<Result<(String, Vec<u8>)>>> {
+ self.oplog.list_do_kv(prefix).await
+ }
+
+ /// Get the current snapshot from the snapshot storage
+ pub async fn get_snapshot(&self) -> Result<Vec<u8>> {
+ let (res, elap) = timeit!(self.snapshot_storage.get_snapshot().await?);
+ trace!(
+ num_bytes = res.len(),
+ duration_ms = elap.as_millis(),
+ "get_snapshot"
+ );
+ Ok(res)
+ }
+
+ /// Store a new snapshot in the snapshot storage
+ pub async fn store_snapshot(&self, doc_state: &DocumentState) -> Result<()> {
+ let snapshot = doc_state.export_snapshot(None)?;
+ let num_bytes = snapshot.len();
+ let (res, elap) = timeit!(self.snapshot_storage.store_snapshot(&snapshot).await?);
+ trace!(
+ num_bytes = num_bytes,
+ duration_ms = elap.as_millis(),
+ "store_snapshot"
+ );
+ self.oplog
+ .store_version_vector(&doc_state.loro_doc.oplog_vv())
+ .await?;
+ Ok(res)
+ }
+
+ /// append a new pending operation to the operation log
+ pub async fn append_pending_operation(
+ &self,
+ operation: &[u8],
+ document_state: &DocumentState,
+ ) -> Result<()> {
+ self.oplog.apply_op(document_state, operation).await?;
+ Ok(())
+ }
+
+ pub async fn clear_applied_ops(&self) -> Result<()> {
+ self.oplog.clear_applied_ops().await?;
+ Ok(())
+ }
+}
+
+pub fn get_snapshot_storage(
+ _env: &Env,
+ _state: &State,
+ document_id: String,
+) -> worker::Result<Storage> {
+ #[cfg(all(feature = "kv-snapshot-storage", feature = "r2-snapshot-storage"))]
+ {
+ compile_error!("features `kv-snapshot-storage` and `r2-snapshot-storage` are incompatible")
+ }
+ #[cfg(feature = "do-sqlite-snapshot-storage")]
+ {
+ crate::storage::backends::combined_sql_kv::Storage::new(_env, _state.storage(), document_id)
+ }
+ #[cfg(feature = "kv-snapshot-storage")]
+ {
+ crate::storage::backends::kv::Kv::from_env(_env, document_id)
+ }
+ #[cfg(feature = "r2-snapshot-storage")]
+ {
+ const DOCUMENT_STATE_BUCKET: &str = "DOCUMENT_SNAPSHOT_BUCKET";
+ let bucket = _env.bucket(DOCUMENT_STATE_BUCKET)?;
+ Ok(crate::storage::backends::r2::R2Storage::new(
+ bucket,
+ document_id,
+ ))
+ }
+}
diff --git a/rust/sync-service/src/storage/op_log.rs b/rust/sync-service/src/storage/op_log.rs
new file mode 100644
index 0000000000..f4e13edd1e
--- /dev/null
+++ b/rust/sync-service/src/storage/op_log.rs
@@ -0,0 +1,160 @@
+#![allow(unused, reason = "relic from op log on r2")]
+use crate::{error::ResultExt, generated::schema::owned::Operation};
+use worker::Result;
+
+pub trait OperationIndexStorage {
+ /// Retrieves a list of all pending operations
+ async fn get_op_log_index(&self) -> Result<Vec<String>>;
+ /// Clears all operations in the operation log
+ async fn clear_op_log_index(&self) -> Result<()>;
+ /// Appends a new operation to the operation log index
+ async fn append_op_log_index(&self, id: &str) -> Result<()>;
+}
+
+pub trait OperationLogStorage {
+ /// Retrieves a single operation from storage
+ async fn get_operation(&self, id: &str) -> Result<Operation>;
+ /// Stores a single operation in storage
+ async fn put_operation(&self, id: &str, operation: Vec<u8>) -> Result<()>;
+ /// Retrieves multiple operations from storage
+ async fn get_operations(&self, ids: Vec<String>) -> Result<Vec<Operation>>;
+}
+const OPERATION_LOG_INDEX_KEY: &str = "operation_log_index";
+
+#[cfg(feature = "kv-snapshot-storage")]
+mod kv_ops {
+ use std::time::Instant;
+
+ use bebop::{Record, SubRecord};
+
+ use crate::storage::backends::durable_kv::DurableKVStorage;
+
+ use super::*;
+ impl OperationIndexStorage for DurableKVStorage {
+ async fn get_op_log_index(&self) -> Result<Vec<String>> {
+ let index = self
+ .get::<Vec<String>>(OPERATION_LOG_INDEX_KEY)
+ .await
+ .unwrap_or_default();
+ Ok(index)
+ }
+
+ async fn clear_op_log_index(&self) -> Result<()> {
+ self.put::<Vec<u8>>(OPERATION_LOG_INDEX_KEY, vec![]).await?;
+ Ok(())
+ }
+
+ async fn append_op_log_index(&self, id: &str) -> Result<()> {
+ let mut index = self
+ .get::<Vec<String>>(OPERATION_LOG_INDEX_KEY)
+ .await
+ .unwrap_or_default();
+
+ index.push(id.to_string());
+ self.put(OPERATION_LOG_INDEX_KEY, index).await?;
+ Ok(())
+ }
+ }
+
+ impl OperationLogStorage for DurableKVStorage {
+ /// Retrieves a single operation from storage
+ async fn get_operation(&self, operation_id: &str) -> Result<Operation> {
+ let key = format!("{}/operation_log/{}.op", self.document_id, operation_id);
+ let value = self.get::<Vec<u8>>(&key).await?;
+ let operation = Operation::deserialize(value.as_slice()).with_context(|| {
+ format!("Couldn't deserialize operation with operation_id: [{operation_id}]")
+ })?;
+ Ok(operation)
+ }
+
+ /// Stores a single operation in storage
+ async fn put_operation(&self, id: &str, update: Vec<u8>) -> Result<()> {
+ let key = format!("{}/operation_log/{}.op", self.document_id, id);
+ let timestamp = bebop::Date::from_millis(Instant::now().elapsed().as_millis() as u64);
+ let operation = Operation { update, timestamp };
+ let mut buf = Vec::with_capacity(operation.serialized_size());
+ operation
+ .serialize(&mut buf)
+ .context("Couldn't serialize operation")?;
+ self.put(&key, buf).await?;
+ Ok(())
+ }
+ /// Retrieves multiple operations from storage
+ async fn get_operations(&self, ids: Vec<String>) -> Result<Vec<Operation>> {
+ let mut operations = Vec::with_capacity(ids.len());
+ for id in ids {
+ let operation = self.get_operation(&id).await?;
+ operations.push(operation);
+ }
+ Ok(operations)
+ }
+ }
+}
+
+#[cfg(feature = "r2-snapshot-storage")]
+mod r2 {
+
+ use std::time::Instant;
+
+ use bebop::{Record, SubRecord};
+
+ use crate::storage::backends::r2::R2Storage;
+
+ use super::*;
+ impl OperationLogStorage for R2Storage {
+ async fn get_operation(&self, id: &str) -> Result<Operation> {
+ // Format of the key is <document_id>/operation_log/<operation_id>
+ let key = format!("{}/operation_log/{}.op", self.document_id, id);
+ let value = self.get::<Vec<u8>>(&key).await?;
+ let operation = Operation::deserialize(value.as_slice()).with_context(|| {
+ format!("Couldn't deserialize operation with operation_id: [{id}]")
+ })?;
+ Ok(operation)
+ }
+
+ async fn put_operation(&self, id: &str, update: Vec<u8>) -> Result<()> {
+ // Format of the key is <document_id>/operation_log/<operation_id>
+ let key = format!("{}/operation_log/{}.op", self.document_id, id);
+ // TODO this is always zero????????
+ let timestamp = bebop::Date::from_millis(Instant::now().elapsed().as_millis() as u64);
+ let operation = Operation { update, timestamp };
+ let mut buf = Vec::with_capacity(operation.serialized_size());
+ operation
+ .serialize(&mut buf)
+ .context("Couldn't serialize operation")?;
+ self.put(&key, buf).await?;
+ Ok(())
+ }
+
+ async fn get_operations(&self, ids: Vec<String>) -> Result<Vec<Operation>> {
+ let mut operations = Vec::with_capacity(ids.len());
+ for id in ids {
+ let operation = self.get_operation(&id).await?;
+ operations.push(operation);
+ }
+ Ok(operations)
+ }
+ }
+
+ impl OperationIndexStorage for R2Storage {
+ async fn get_op_log_index(&self) -> Result<Vec<String>> {
+ let key = format!("{}/operation_log/index", self.document_id);
+ let index = self.get::<Vec<String>>(&key).await.unwrap_or_default();
+ Ok(index)
+ }
+
+ async fn clear_op_log_index(&self) -> Result<()> {
+ let key = format!("{}/operation_log/index", self.document_id);
+ self.put::<Vec<u8>>(&key, vec![]).await?;
+ Ok(())
+ }
+
+ async fn append_op_log_index(&self, id: &str) -> Result<()> {
+ let key = format!("{}/operation_log/index", self.document_id);
+ let mut index = self.get::<Vec<String>>(&key).await.unwrap_or_default();
+ index.push(id.to_string());
+ self.put(&key, index).await?;
+ Ok(())
+ }
+ }
+}
diff --git a/rust/sync-service/src/storage/snapshot.rs b/rust/sync-service/src/storage/snapshot.rs
new file mode 100644
index 0000000000..395935af6d
--- /dev/null
+++ b/rust/sync-service/src/storage/snapshot.rs
@@ -0,0 +1,8 @@
+pub trait SnapshotStorage {
+ /// Stores a snapshot in the storage
+ async fn store_snapshot(&self, snapshot: &[u8]) -> worker::Result<()>;
+ /// Retrieves a snpashot from the storage
+ async fn get_snapshot(&self) -> worker::Result<Vec<u8>>;
+ /// Checks if a snapshot exists in the storage
+ async fn has_snapshot(&self) -> worker::Result<bool>;
+}
diff --git a/rust/sync-service/src/tags.rs b/rust/sync-service/src/tags.rs
new file mode 100644
index 0000000000..7e4b1858e7
--- /dev/null
+++ b/rust/sync-service/src/tags.rs
@@ -0,0 +1,24 @@
+use uuid::Uuid;
+use worker::{Error, Result};
+
+const WS_ID_TAG: &str = "ws_id";
+
+pub fn new_ws_id() -> String {
+ let id = Uuid::new_v4().to_string();
+ format!("{WS_ID_TAG}{id}")
+}
+
+pub fn get_ws_id_from_tags(tags: &[String]) -> Result<String> {
+ let Some(tag) = tags.first() else {
+ return Err(Error::from(format!(
+ "websocket should only have exactly one tag! tags = {tags:?}"
+ )));
+ };
+ if tag.starts_with(WS_ID_TAG) {
+ Ok(tag.clone())
+ } else {
+ Err(Error::from(format!(
+ "WebSocket tag has an unknown prefix: whole_tag = {tag} expected prefix = {WS_ID_TAG}"
+ )))
+ }
+}
diff --git a/rust/sync-service/src/timeout.rs b/rust/sync-service/src/timeout.rs
new file mode 100644
index 0000000000..ac53ec5834
--- /dev/null
+++ b/rust/sync-service/src/timeout.rs
@@ -0,0 +1,159 @@
+use std::future::Future;
+use std::pin::Pin;
+use std::task::{Context, Poll};
+use tracing::error;
+use worker::wasm_bindgen::JsCast;
+use worker::wasm_bindgen_futures::JsFuture;
+use worker::worker_sys::web_sys::{WorkerGlobalScope, js_sys};
+
+pub const DEFAULT_TIMEOUT_MS: u32 = 4_500;
+
+/// Error type for timeout operations
+#[derive(Debug, Clone)]
+pub struct TimeoutError {
+ duration_ms: u32,
+}
+impl From<TimeoutError> for worker::Error {
+ fn from(value: TimeoutError) -> Self {
+ worker::Error::from(format!("{value}"))
+ }
+}
+
+impl TimeoutError {
+ pub fn new(duration_ms: u32) -> Self {
+ Self { duration_ms }
+ }
+}
+
+impl std::fmt::Display for TimeoutError {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "Operation timed out after {}ms", self.duration_ms)
+ }
+}
+
+impl std::error::Error for TimeoutError {}
+
+/// Timeout result - either the operation completed or it timed out
+#[derive(Debug)]
+pub enum TimeoutResult<T> {
+ /// The operation completed successfully
+ Ok(T),
+ /// The operation timed out
+ Timeout(TimeoutError),
+}
+
+/// Creates a timeout future that resolves after the specified duration
+fn create_timeout_future(duration_ms: u32) -> JsFuture {
+ let promise = js_sys::Promise::new(&mut |resolve, _reject| {
+ let timeout_id = js_sys::global()
+ .unchecked_into::<WorkerGlobalScope>()
+ .set_timeout_with_callback_and_timeout_and_arguments_0(&resolve, duration_ms as i32)
+ .expect("Failed to set timeout");
+
+ // Store timeout_id if we need to cancel it later
+ // For now, we let it run to completion
+ _ = timeout_id;
+ });
+
+ JsFuture::from(promise)
+}
+
+/// A future that races an operation against a timeout
+pub struct Timeout<F> {
+ future: Pin<Box<F>>,
+ timeout_future: Pin<Box<JsFuture>>,
+ duration_ms: u32,
+ completed: bool,
+}
+
+impl<F> Timeout<F>
+where
+ F: Future,
+{
+ fn new(future: F, duration_ms: u32) -> Self {
+ Self {
+ future: Box::pin(future),
+ timeout_future: Box::pin(create_timeout_future(duration_ms)),
+ duration_ms,
+ completed: false,
+ }
+ }
+}
+
+impl<F> Future for Timeout<F>
+where
+ F: Future,
+{
+ type Output = TimeoutResult<F::Output>;
+
+ fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
+ if self.completed {
+ panic!("Timeout future polled after completion");
+ }
+
+ // First check if the main future is ready
+ if let Poll::Ready(result) = self.future.as_mut().poll(cx) {
+ self.completed = true;
+ return Poll::Ready(TimeoutResult::Ok(result));
+ }
+
+ // Then check if the timeout has elapsed
+ if self.timeout_future.as_mut().poll(cx).is_ready() {
+ self.completed = true;
+ error!(
+ timeout_duration_ms = self.duration_ms,
+ "A future has timed out"
+ );
+ return Poll::Ready(TimeoutResult::Timeout(TimeoutError::new(self.duration_ms)));
+ }
+
+ Poll::Pending
+ }
+}
+
+impl<T> TimeoutResult<T> {
+ /// Converts the TimeoutResult into a standard Result
+ pub fn into_result(self) -> Result<T, TimeoutError> {
+ match self {
+ TimeoutResult::Ok(value) => Ok(value),
+ TimeoutResult::Timeout(err) => Err(err),
+ }
+ }
+}
+
+/// Applies a timeout to a future, similar to `tokio::time::timeout`
+///
+/// # Arguments
+/// * `future` - The future to wrap with a timeout
+/// * `duration_ms` - Timeout duration in milliseconds
+///
+/// # Returns
+/// A `TimeoutResult` indicating whether the operation completed or timed out
+///
+/// # Examples
+/// ```rust
+/// use crate::timeout::{timeout, TimeoutResult};
+///
+/// async fn example() {
+/// let result = timeout(some_async_operation(), 5000).await;
+/// match result {
+/// TimeoutResult::Ok(value) => println!("Got result: {:?}", value),
+/// TimeoutResult::Timeout(err) => println!("Operation timed out: {}", err),
+/// }
+/// }
+/// ```
+pub fn timeout<F>(future: F, duration_ms: u32) -> Timeout<F>
+where
+ F: Future,
+{
+ Timeout::new(future, duration_ms)
+}
+
+#[macro_export]
+macro_rules! timeout_ez {
+ ($future:expr) => {
+ $crate::timeout::timeout($future, $crate::timeout::DEFAULT_TIMEOUT_MS)
+ .await
+ .into_result()?
+ };
+}
diff --git a/rust/sync-service/src/websocket.rs b/rust/sync-service/src/websocket.rs
new file mode 100644
index 0000000000..706b43d814
--- /dev/null
+++ b/rust/sync-service/src/websocket.rs
@@ -0,0 +1,224 @@
+use std::{fmt::Display, sync::Arc};
+
+use bebop::{Record, SliceWrapper};
+use loro::{Frontiers, awareness::EphemeralStore};
+use tracing::trace;
+use worker::{Result, WebSocket};
+
+use crate::{
+ durable_object::{DocumentSyncSession, Wsm},
+ error::ResultExt,
+ generated::schema::{FromPeer, FromRemote},
+ mutex::Mutex,
+ state::DocumentState,
+ storage::SessionStorage,
+};
+
+fn serialize<'a, T: bebop::Record<'a>>(
+ obj: T,
+ msg_buf: &mut Vec<u8>,
+) -> std::result::Result<&[u8], bebop::SerializeError> {
+ msg_buf.clear();
+ obj.serialize(msg_buf)?;
+ Ok(msg_buf)
+}
+
+/// Sends the initial sync message to the client over the websocket
+/// The initial sync message contains the snapshot of the current state of the document
+pub fn send_initial_sync(
+ ws: &WebSocket,
+ snapshot: &[u8],
+ awareness: &[u8],
+ buf: Arc<Mutex<Vec<u8>>>,
+) -> Result<()> {
+ let message = FromRemote::RemoteInitialSync {
+ snapshot: SliceWrapper::Raw(snapshot),
+ awareness: SliceWrapper::Raw(awareness),
+ };
+
+ let mut buf = buf.lock("serialize RemoteInitialSync in send_initial_sync");
+ let serialized = serialize(message, &mut buf).context("Failed serializing snapshot")?;
+ ws.send_with_bytes(serialized)
+ .context("failed to send initial sync message")?;
+ Ok(())
+}
+
+// Broadcasts a shallow snapshot of the document state to all connected clients
+pub fn broadcast_snapshot(
+ sockets: &[WebSocket],
+ snapshot: &[u8],
+ buf: Arc<Mutex<Vec<u8>>>,
+) -> Result<()> {
+ let message = FromRemote::RemoteSnapshot {
+ snapshot: SliceWrapper::Raw(snapshot),
+ };
+
+ let mut buf = buf.lock("serialize RemoteSnapshot in broadcast_snapshot");
+ let serialized = serialize(message, &mut buf).context("Failed serializing snapshot")?;
+ for ws in sockets {
+ ws.send_with_bytes(serialized)
+ .context("failed to send update message")?;
+ }
+ Ok(())
+}
+
+pub fn broadcast_awareness(
+ from_socket: &WebSocket,
+ sockets: &[WebSocket],
+ awareness: &[u8],
+ buf: Arc<Mutex<Vec<u8>>>,
+) -> Result<()> {
+ let message = FromRemote::RemoteAwareness {
+ awareness: SliceWrapper::Raw(awareness),
+ };
+
+ let mut buf = buf.lock("serialize RemoteAwareness in broadcast_awareness");
+ let serialized = serialize(message, &mut buf).context("TODO")?;
+
+ for w in sockets.iter().filter(|w| w != &from_socket) {
+ w.send_with_bytes(serialized).context("failed to send")?;
+ }
+
+ Ok(())
+}
+
+impl Display for FromPeer<'_> {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ let m = match self {
+ FromPeer::Unknown => "Unknown",
+ FromPeer::PeerUpdate { .. } => "PeerUpdate",
+ FromPeer::PeerAwareness { .. } => "PeerAwareness",
+ FromPeer::PeerRequestSince { .. } => "PeerRequestSince",
+ FromPeer::PeerRequestSnapshot {} => "PeerRequestSnapshot",
+ FromPeer::PeerRegisterId { .. } => "PeerRegisterId",
+ };
+ write!(f, "{m}")
+ }
+}
+
+// Max receiving websocket message is 1Mb
+const MAX_MESSAGE_SIZE: usize = 1000 * 1000;
+
+#[allow(
+ clippy::too_many_arguments,
+ reason = "lots of args lets us avoid having multiple mutable refs to same object"
+)]
+pub async fn process_message(
+ ws: &WebSocket,
+ document_id: &str,
+ document_state: &DocumentState,
+ session_storage: &SessionStorage,
+ awareness: &EphemeralStore,
+ message: Vec<u8>,
+ buf: Arc<Mutex<Vec<u8>>>,
+ dss: &DocumentSyncSession,
+) -> Result<()> {
+ if message.len() > MAX_MESSAGE_SIZE {
+ tracing::warn!("received message might be too large {}", message.len());
+ }
+
+ let message: FromPeer = FromPeer::deserialize(message.as_slice()).context(format!(
+ "failed to deserialize message, message length {}",
+ message.len()
+ ))?;
+
+ trace!(
+ message = tracing::field::display(&message),
+ "process websocket message"
+ );
+ match message {
+ // Handle peer id registration
+ // This registers a peer id to the owner of the current websocket
+ FromPeer::PeerRegisterId { peerid } => {
+ Wsm::new(dss, ws)
+ .add_new_peerid(peerid, document_id)
+ .await?;
+ }
+ // Handle an incoming update from a peer
+ // Should extract binary update and broadcast it to all other connected peers
+ // Should also store the update in the operation log to be applied to the remote doc
+ FromPeer::PeerUpdate { update } => {
+ if !Wsm::new(dss, ws).can_edit().await? {
+ tracing::warn!("received update from peer without edit permission");
+ return Ok(());
+ }
+ session_storage
+ .append_pending_operation(&update, document_state)
+ .await?;
+
+ {
+ // send update to peers
+ let message = FromRemote::RemoteUpdate {
+ update: SliceWrapper::Raw(&update),
+ };
+
+ let mut buf = buf.lock("serialize RemoteUpdate in PeerUpdate handler");
+ let serialized =
+ serialize(message, &mut buf).context("Failed serializing update")?;
+ for w in dss.get_websockets().iter().filter(|w| w != &ws) {
+ w.send_with_bytes(serialized).context("failed to send")?;
+ }
+ }
+
+ {
+ // send ACK
+ let message = FromRemote::RemoteUpdateAck {
+ update: SliceWrapper::Raw(&update),
+ };
+ let mut buf = buf.lock("serialize RemoteUpdateAck in PeerUpdate handler");
+ let serialized =
+ serialize(message, &mut buf).context("Failed serializing update")?;
+ ws.send_with_bytes(serialized).context("failed to send")?;
+ }
+ }
+ // Handle an incoming awareness update from a peer
+ // Should apply the update to the local epehemeral awareness strore
+ FromPeer::PeerAwareness {
+ awareness: awareness_update,
+ } => {
+ awareness.apply(*awareness_update);
+ let encodede = awareness.encode_all();
+ broadcast_awareness(ws, &dss.get_websockets(), &encodede, buf)
+ .context("failed to broadcast awareness")?;
+ }
+ // Handle a peer requesting a specific set of updates from the document
+ FromPeer::PeerRequestSince { frontiers } => {
+ let frontiers = Frontiers::decode(*frontiers).context("failed to decode frontiers")?;
+
+ let update = document_state
+ .export_updates_since(&frontiers)
+ .context("failed to export updates")?;
+
+ let encoded_frontiers = frontiers.encode();
+
+ let message = FromRemote::RemoteUpdateSince {
+ update: SliceWrapper::Raw(&update),
+ frontiers: SliceWrapper::Raw(&encoded_frontiers),
+ };
+
+ let mut buf = buf.lock("serialize RemoteUpdate in PeerRequestSince handler");
+ let serialized =
+ serialize(message, &mut buf).context("failed serializing PeerRequestSince")?;
+ ws.send_with_bytes(serialized)
+ .context("failed to send update")?;
+ }
+ // Peer is requesting a snapshot from the remote
+ FromPeer::PeerRequestSnapshot {} => {
+ let snapshot = document_state.export_shallow_snapshot()?;
+
+ let message = FromRemote::RemoteSnapshot {
+ snapshot: SliceWrapper::Raw(&snapshot),
+ };
+ let mut buf = buf.lock("serialize RemoteSnapshot in PeerRequestSnapshot handler");
+ let serialized =
+ serialize(message, &mut buf).context("failed serializing PeerRequestSnapshot")?;
+ ws.send_with_bytes(serialized)
+ .context("failed to send update")?;
+ }
+ FromPeer::Unknown => {
+ return Err(worker::Error::from("unknown message type"));
+ }
+ };
+
+ Ok(())
+}
diff --git a/rust/sync-service/tests/active_peers.test.ts b/rust/sync-service/tests/active_peers.test.ts
new file mode 100644
index 0000000000..f1ea8b9e0c
--- /dev/null
+++ b/rust/sync-service/tests/active_peers.test.ts
@@ -0,0 +1,187 @@
+import { Miniflare } from "miniflare";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("active_peers endpoint tests", async () => {
+ test("should return active peer IDs for document with single user", async () => {
+ // Create a document with one user
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Hello from single user!");
+
+ // Wait for the change to be processed
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Get token for API access
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch active peer IDs
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const activePeerIds = await response.json();
+ expect(activePeerIds).toBeDefined();
+ expect(Array.isArray(activePeerIds)).toBe(true);
+ expect(activePeerIds.length).toBe(1);
+ expect(activePeerIds[0]).toBe(user.doc.peerIdStr);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return multiple active peer IDs for document with multiple users", async () => {
+ // Create document with multiple users
+ const userA = await createTestUser(mf, "test-doc", { userId: "user-a" });
+ const userB = await createTestUser(mf, "test-doc", { userId: "user-b" });
+ const userC = await createTestUser(mf, "test-doc", { userId: "user-c" });
+
+ userA.makeChange("Change from user A");
+ userB.makeChange(" - Change from user B");
+ userC.makeChange(" - Change from user C");
+
+ // Wait for changes to be processed
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch active peer IDs
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const activePeerIds = await response.json();
+ expect(activePeerIds).toBeDefined();
+ expect(Array.isArray(activePeerIds)).toBe(true);
+ expect(activePeerIds.length).toBe(3);
+
+ // Verify all peer IDs are present
+ expect(activePeerIds).toContain(userA.doc.peerIdStr);
+ expect(activePeerIds).toContain(userB.doc.peerIdStr);
+ expect(activePeerIds).toContain(userC.doc.peerIdStr);
+
+ // Clean up connections
+ userA.connection.getWebSocket().close();
+ userB.connection.getWebSocket().close();
+ userC.connection.getWebSocket().close();
+ });
+
+ test("should require authentication for active_peers endpoint", async () => {
+ // Create document
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Protected content");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Try to fetch without token
+ const responseWithoutAuth = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers"
+ );
+
+ expect(responseWithoutAuth.status).toBe(401);
+
+ // Try with invalid token
+ const responseWithBadToken = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer invalid-token",
+ },
+ }
+ );
+
+ expect(responseWithBadToken.status).toBe(401);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return empty array for non-existent document", async () => {
+ const token = getTokenForDocument("non-existent-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/non-existent-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ // Should return 200 with empty array or 404, depending on implementation
+ expect([200, 404]).toContain(response.status);
+
+ if (response.status === 200) {
+ const activePeerIds = await response.json();
+ expect(Array.isArray(activePeerIds)).toBe(true);
+ expect(activePeerIds.length).toBe(0);
+ }
+ });
+
+ test("should update active peer IDs when user disconnects", async () => {
+ // Create document with two users
+ const userA = await createTestUser(mf, "test-doc", { userId: "user-a" });
+ const userB = await createTestUser(mf, "test-doc", { userId: "user-b" });
+
+ userA.makeChange("User A content");
+ userB.makeChange("User B content");
+
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Initially should have 2 active peers
+ let response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ let activePeerIds = await response.json();
+ expect(activePeerIds.length).toBe(2);
+
+ // Disconnect one user
+ userA.connection.getWebSocket().close();
+
+ // Wait for disconnect to be processed
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+
+ // Should now have 1 active peer
+ response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/active_peers",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ activePeerIds = await response.json();
+ expect(activePeerIds.length).toBe(1);
+ expect(activePeerIds[0]).toBe(userB.doc.peerIdStr);
+
+ userB.connection.getWebSocket().close();
+ }, 10000);
+});
diff --git a/rust/sync-service/tests/awareness.test.ts b/rust/sync-service/tests/awareness.test.ts
new file mode 100644
index 0000000000..7ecaca6dda
--- /dev/null
+++ b/rust/sync-service/tests/awareness.test.ts
@@ -0,0 +1,66 @@
+import { Miniflare } from "miniflare";
+import {
+ FromPeer,
+ FromRemote,
+ RemoteAwareness,
+} from "../bebop/generated/schema";
+import { expect, test, describe, beforeAll } from "vitest";
+import { createTestUser, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeAll(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("awareness sync tests", () => {
+ test("should include awareness on connection if available", async () => {
+ const userA = await createTestUser(mf, "1234");
+ // Initialize with some text
+ userA.doc.getText("content").push("hello world");
+ const cursor = userA.doc.getText("content").getCursor(5);
+ expect(cursor).toBeDefined();
+ userA.doc.commit();
+ userA.awareness.set(userA.doc.peerIdStr, {
+ cursor: cursor!.encode(),
+ })
+ let awarenessUpdate = userA.awareness.encode(userA.doc.peerIdStr);
+ const update = userA.doc.export({ mode: "update" });
+
+ userA.connection.send(FromPeer.fromPeerUpdate({ update}).encode());
+ userA.connection.send(FromPeer.fromPeerAwareness({ awareness: awarenessUpdate }).encode());
+
+ const userB = await createTestUser(mf, "1234");
+ expect(userB.awareness.getAllStates()[userA.doc.peerIdStr]).toBeDefined();
+ });
+
+ test("should broadcast awareness when one client disconnects", async () => {
+ const userA = await createTestUser(mf, "1234");
+ // Initialize with some text
+ userA.doc.getText("content").push("hello world");
+ const cursor = userA.doc.getText("content").getCursor(5);
+ expect(cursor).toBeDefined();
+ userA.doc.commit();
+ userA.awareness.set(userA.doc.peerIdStr, {
+ cursor: cursor!.encode(),
+ })
+ let awarenessUpdate = userA.awareness.encode(userA.doc.peerIdStr);
+ const update = userA.doc.export({ mode: "update" });
+
+ userA.connection.send(FromPeer.fromPeerUpdate({ update}).encode());
+ userA.connection.send(FromPeer.fromPeerAwareness({ awareness: awarenessUpdate }).encode());
+
+ const userB = await createTestUser(mf, "1234");
+ expect(userB.awareness.getAllStates()[userA.doc.peerIdStr]).toBeDefined();
+
+ // When userA disconnects, the service should broadcast an undefined awareness update
+ // for userA to all listeners
+ userA.connection.getWebSocket().close();
+
+ let newMessage = await userB.connection.waitForNextMessage();
+ const awareness = FromRemote.decode(new Uint8Array(newMessage));
+ expect(awareness.isRemoteAwareness()).toBeTruthy();
+ userB.awareness.apply((awareness.value as RemoteAwareness ).awareness);
+ expect(userB.awareness.getAllStates()[userA.doc.peerIdStr]).toBeUndefined();
+ })
+})
diff --git a/rust/sync-service/tests/copy_endpoint.test.ts b/rust/sync-service/tests/copy_endpoint.test.ts
new file mode 100644
index 0000000000..f52777aa72
--- /dev/null
+++ b/rust/sync-service/tests/copy_endpoint.test.ts
@@ -0,0 +1,199 @@
+import { Miniflare } from "miniflare";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, setupMiniflare, createDocument, copyDocument } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+// Helper functions
+const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
+
+describe("document copy endpoint tests", () => {
+ test("should copy document with content", async () => {
+ let doc = await createDocument(mf);
+ const user = await doc.createUser();
+ user.makeChange("Original content");
+
+ await wait(500); // Wait for snapshot
+ let doc2 = await doc.copy();
+
+ const copiedUser = await doc2.createUser();
+ expect(copiedUser.getState()).toBe("Original content");
+
+ user.connection.getWebSocket().close();
+ copiedUser.connection.getWebSocket().close();
+ }, 3000);
+
+ test("should copy document to specific version", async () => {
+ let doc = await createDocument(mf);
+ let user = await doc.createUser();
+
+ user.makeChange("Version 1");
+ const v1Frontier = user.doc.vvToFrontiers(user.doc.version())[0];
+
+ user.makeChange(" -> Version 2");
+ const v2Frontier = user.doc.vvToFrontiers(user.doc.version())[0];
+
+ user.makeChange(" -> Version 3");
+ await wait(500);
+
+ // Copy to v1
+ const v1 = await doc.copy("copy-v1", {
+ peer: v1Frontier.peer,
+ counter: v1Frontier.counter,
+ });
+ const v2 = await doc.copy("copy-v2", {
+ peer: v2Frontier.peer,
+ counter: v2Frontier.counter,
+ });
+
+ // Verify versions
+ const copyV1 = await v1.createUser();
+ expect(copyV1.getState()).toBe("Version 1");
+
+ const copyV2 = await v2.createUser();
+ expect(copyV2.getState()).toBe("Version 1 -> Version 2");
+
+ [user, copyV1, copyV2].forEach(u => u.connection.getWebSocket().close());
+
+ }, 3000);
+
+ test("should require internal auth for copy", async () => {
+ let doc = await createDocument(mf);
+ let user = await doc.createUser();
+ user.makeChange("Protected content");
+
+ await wait(500);
+ // Try to copy without internal auth key
+ const response = await mf.dispatchFetch(
+ `http://localhost:8787/document/${doc.name}/copy`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ target_document_id: "unauthorized-copy" }),
+ }
+ );
+
+ expect(response.status).toBe(401);
+ user.connection.getWebSocket().close();
+
+ }, 3000);
+
+ test("should handle copying non-existent document", async () => {
+ const response = await copyDocument(mf, "non-existent-doc", "copy-of-nothing");
+ expect(response.status).toBe(404);
+ });
+
+ test("should copy document with multiple changes", async () => {
+ let doc = await createDocument(mf);
+ let [userA, userB] = await doc.createMultipleUsers(2);
+
+ userA.makeChange('A1');
+ await wait(100);
+ await userB.importNextUpdate();
+
+ userB.makeChange('B1');
+ await wait(100);
+ await userA.importNextUpdate();
+
+ userA.makeChange('A2');
+ await wait(100);
+ await userB.importNextUpdate();
+
+ userB.makeChange('B2');
+ await wait(100);
+ await userA.importNextUpdate();
+
+ expect(userA.getState()).toBe("A1B1A2B2");
+ expect(userB.getState()).toBe("A1B1A2B2");
+
+ let doc2 = await doc.copy();
+ await wait(100);
+ let userdoc2 = await doc2.createUser();
+ expect(userdoc2.getState()).toBe('A1B1A2B2');
+
+ [userA, userB, userdoc2].forEach(u => u.connection.getWebSocket().close());
+ }, 15000);
+
+
+ test("should not affect source document when copying", async () => {
+ let doc = await createDocument(mf);
+ let source = await doc.createUser();
+ source.makeChange("Original data");
+
+ await wait(500);
+
+ let doc_copied = await doc.copy();
+ let user_copied = await doc_copied.createUser();
+
+ user_copied.makeChange(" - Modified in copy");
+
+ await wait(500);
+
+ const sourceCheck = await doc.createUser();
+
+ expect(sourceCheck.getState()).toBe("Original data");
+ expect(user_copied.getState()).toBe("Original data - Modified in copy");
+
+ [source, user_copied, sourceCheck].forEach(u => u.connection.getWebSocket().close());
+ }, 3000);
+
+ test("should handle copy with empty document", async () => {
+ let doc = await createDocument(mf);
+ let user = await doc.createUser();
+ await wait(500);
+
+ let copy = await doc.copy();
+ await wait(500);
+ let copiedUser = await copy.createUser();
+ await wait(500);
+ expect(copiedUser.getState()).toBe("");
+
+ [user, copiedUser].forEach(u => u.connection.getWebSocket().close());
+
+ }, 3000);
+
+ test("should handle overwriting existing target document", async () => {
+ // Create source
+ const source = await createTestUser(mf, "source-overwrite");
+ source.makeChange("Source content");
+ await wait(500);
+
+ // Create target with different content
+ const target = await createTestUser(mf, "target-overwrite");
+ target.makeChange("Target content");
+ await wait(500);
+
+ // Copy source to target (should overwrite or fail depending on implementation)
+ const response = await copyDocument(mf, "source-overwrite", "target-overwrite");
+
+ // Depending on implementation, this might be 200 (overwrite) or 409/500 (conflict)
+ // Adjust based on actual behavior
+ expect([200, 409, 500]).toContain(response.status);
+
+ [source, target].forEach(u => u.connection.getWebSocket().close());
+ }, 15000);
+
+ test("should preserve document structure in copy", async () => {
+ const user = await createTestUser(mf, "structured-doc");
+
+ // Create structured content (using Loro's text operations)
+ user.makeChange("Line 1");
+ user.makeChange("\nLine 2");
+ user.makeChange("\nLine 3");
+ await wait(500);
+
+ const response = await copyDocument(mf, "structured-doc", "structured-copy");
+ expect(response.status).toBe(200);
+
+ const copiedUser = await createTestUser(mf, "structured-copy");
+ expect(copiedUser.getState()).toBe("Line 1\nLine 2\nLine 3");
+
+ [user, copiedUser].forEach(u => u.connection.getWebSocket().close());
+ }, 10000);
+});
diff --git a/rust/sync-service/tests/cors.test.ts b/rust/sync-service/tests/cors.test.ts
new file mode 100644
index 0000000000..6c34818ece
--- /dev/null
+++ b/rust/sync-service/tests/cors.test.ts
@@ -0,0 +1,212 @@
+import { Miniflare } from "miniflare";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("CORS middleware tests", async () => {
+ test("should allow requests from whitelisted origins", async () => {
+ const allowedOrigins = [
+ "http://localhost:5173",
+ "http://localhost:3000",
+ "http://host.local:3000",
+ "https://dev.macro.com",
+ "https://staging.macro.com",
+ "https://www.macro.com",
+ "https://macro.com",
+ "capacitor://localhost",
+ "https://apollo-testing.macro.com",
+ "https://my-feature-branch.preview.macro.com",
+ "https://fix-123.preview.macro.com",
+ ];
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ for (const origin of allowedOrigins) {
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ Origin: origin,
+ },
+ }
+ );
+
+ // Should get 404 (document doesn't exist) but CORS should be allowed
+ expect([200, 404]).toContain(response.status);
+
+ // Check CORS headers
+ expect(response.headers.get("Access-Control-Allow-Origin")).toBe(origin);
+ expect(response.headers.get("Access-Control-Allow-Credentials")).toBe("true");
+ }
+ });
+
+ test("should handle preflight OPTIONS requests", async () => {
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ method: "OPTIONS",
+ headers: {
+ Origin: "https://dev.macro.com",
+ "Access-Control-Request-Method": "GET",
+ "Access-Control-Request-Headers": "authorization, content-type",
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ // Check preflight response headers
+ expect(response.headers.get("Access-Control-Allow-Origin")).toBe("https://dev.macro.com");
+ expect(response.headers.get("Access-Control-Allow-Credentials")).toBe("true");
+ expect(response.headers.get("Access-Control-Allow-Methods")).toContain("GET");
+ expect(response.headers.get("Access-Control-Allow-Methods")).toContain("POST");
+ expect(response.headers.get("Access-Control-Allow-Methods")).toContain("OPTIONS");
+ expect(response.headers.get("Access-Control-Allow-Headers")).toContain("authorization");
+ expect(response.headers.get("Access-Control-Allow-Headers")).toContain("content-type");
+ });
+
+ test("should reject requests from non-whitelisted origins", async () => {
+ const disallowedOrigins = [
+ "https://malicious.com",
+ "http://localhost:8080",
+ "https://evil.macro.com",
+ "https://fake-dashboard.macro.com",
+ "http://evil.preview.macro.com", // HTTP not allowed for preview
+ "https://preview.macro.com", // Must have subdomain
+ "https://evil.preview.macro.com.attacker.com", // Suffix attack
+ ];
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ for (const origin of disallowedOrigins) {
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ Origin: origin,
+ },
+ }
+ );
+
+ // CORS should block the request or not set Access-Control-Allow-Origin
+ const allowedOrigin = response.headers.get("Access-Control-Allow-Origin");
+ expect(allowedOrigin).not.toBe(origin);
+ }
+ });
+
+ test("should allow all HTTP methods for whitelisted origins", async () => {
+ const methods = ["GET", "POST", "PUT", "PATCH", "DELETE"];
+ const origin = "https://dev.macro.com";
+
+ for (const method of methods) {
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ method: "OPTIONS",
+ headers: {
+ Origin: origin,
+ "Access-Control-Request-Method": method,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ const allowedMethods = response.headers.get("Access-Control-Allow-Methods");
+ expect(allowedMethods).toContain(method);
+ }
+ });
+
+ test("should allow required headers for API requests", async () => {
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ method: "OPTIONS",
+ headers: {
+ Origin: "https://dev.macro.com",
+ "Access-Control-Request-Method": "GET",
+ "Access-Control-Request-Headers": "authorization",
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ const allowedHeaders = response.headers.get("Access-Control-Allow-Headers");
+ expect(allowedHeaders).toContain("authorization");
+ expect(allowedHeaders).toContain("content-type");
+ });
+
+ test("should work with actual API requests after CORS validation", async () => {
+ // Create a document first
+ const user = await createTestUser(mf, "cors-test-doc");
+ user.makeChange("CORS test content");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ const token = getTokenForDocument("cors-test-doc", "test-user", "owner");
+
+ // Make actual API request with CORS headers
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/cors-test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ Origin: "https://dev.macro.com",
+ "Content-Type": "application/json",
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ // Verify both API response and CORS headers
+ const metadata = await response.json();
+ expect(metadata.id).toBe("cors-test-doc");
+
+ expect(response.headers.get("Access-Control-Allow-Origin")).toBe("https://dev.macro.com");
+ expect(response.headers.get("Access-Control-Allow-Credentials")).toBe("true");
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should handle mobile app origins (Capacitor)", async () => {
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ Origin: "capacitor://localhost",
+ },
+ }
+ );
+
+ // Should allow Capacitor origin
+ expect(response.headers.get("Access-Control-Allow-Origin")).toBe("capacitor://localhost");
+ expect(response.headers.get("Access-Control-Allow-Credentials")).toBe("true");
+ });
+
+ test("should handle requests without Origin header", async () => {
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ // No Origin header
+ },
+ }
+ );
+
+ // Should work for same-origin requests (no Origin header)
+ expect([200, 404]).toContain(response.status);
+ });
+});
diff --git a/rust/sync-service/tests/debug_endpoint.test.ts b/rust/sync-service/tests/debug_endpoint.test.ts
new file mode 100644
index 0000000000..07bd1c0e15
--- /dev/null
+++ b/rust/sync-service/tests/debug_endpoint.test.ts
@@ -0,0 +1,106 @@
+import { Miniflare } from "miniflare";
+import { expect, test, describe, beforeEach } from "vitest";
+import { log, createTestUser, getTokenForDocument, INTERNAL_API_SECRET, setupMiniflare, sleep } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+// Helper functions
+
+const admin_headers = { 'x-internal-auth-key': INTERNAL_API_SECRET };
+
+const callEndpoint = (path: string, docId: string, headers) => {
+ return mf.dispatchFetch(`http://localhost:8787/document/${docId}/${path}`, { headers });
+};
+
+const callDebugEndpoint = (docId: string, headers = {...admin_headers}) => {
+ return callEndpoint('debug_dump_operations', docId, headers);
+};
+
+const callWakeupEndpoint = (docId: string, headers = {...admin_headers}) => {
+ return callEndpoint('wakeup', docId, headers);
+};
+
+const expectValidDebugResponse = async (response: Response) => {
+ expect(response.status).toBe(200);
+ const data = await response.json();
+ expect(Array.isArray(data)).toBe(true);
+ return data;
+};
+
+describe("debug endpoint tests", async () => {
+ test("should return KV dump with admin auth", async () => {
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Debug test content");
+ await sleep(200);
+
+ const response = await callDebugEndpoint("test-doc");
+ const debugData = await expectValidDebugResponse(response);
+
+ console.log("Debug data entries:", debugData.length);
+ user.connection.getWebSocket().close();
+ });
+
+ test("should require admin authentication", async () => {
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Protected content");
+ await sleep(100);
+
+ // Without admin key
+ const response = await callDebugEndpoint("test-doc", {});
+ expect(response.status).toBe(401);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return 404 for non-existent document", async () => {
+ const response = await callDebugEndpoint("missing-doc");
+ expect(response.status).toBe(404);
+ });
+
+ test("should show KV contents after multiple operations", async () => {
+ const [userA, userB] = await Promise.all([
+ createTestUser(mf, "multi-doc", { userId: "user-a" }),
+ createTestUser(mf, "multi-doc", { userId: "user-b" })
+ ]);
+
+ userA.makeChange("Op 1");
+ userB.makeChange(" - Op 2");
+ userA.makeChange(" - Op 3");
+ await sleep(300);
+
+ const response = await callDebugEndpoint("multi-doc");
+ const debugData = await expectValidDebugResponse(response);
+
+ expect(debugData.length).toBeGreaterThan(0);
+ console.log("Multi-op debug entries:", debugData.length);
+
+ [userA, userB].forEach(user => user.connection.getWebSocket().close());
+ });
+
+ test("should handle empty document", async () => {
+ const user = await createTestUser(mf, "empty-doc");
+ user.connection.getWebSocket().close();
+ await sleep(100);
+
+ const response = await callDebugEndpoint("empty-doc");
+ const debugData = await expectValidDebugResponse(response);
+
+ console.log("Empty doc debug entries:", debugData.length);
+ });
+});
+describe("wakeup endpoint tests", async () => {
+ test("test wakeup", async () => {
+ const user = await createTestUser(mf, "empty-doc");
+ user.connection.getWebSocket().close();
+ await sleep(1000);
+
+ let first = await (await callWakeupEndpoint("empty-doc")).json();
+ expect(first).toBeNull();
+ let [_tid, duration] = await(await callWakeupEndpoint("empty-doc")).json();
+ expect(duration).toBe(60 * 1000);
+ })
+});
diff --git a/rust/sync-service/tests/document_api.test.ts b/rust/sync-service/tests/document_api.test.ts
new file mode 100644
index 0000000000..ac4066c1cb
--- /dev/null
+++ b/rust/sync-service/tests/document_api.test.ts
@@ -0,0 +1,221 @@
+import { Miniflare } from "miniflare";
+import { LoroDoc } from "loro-crdt";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+import { InitializeFromSnapshotRequest } from "../bebop/generated/schema";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("document api tests", async () => {
+ test("should properly initialize the document", async () => {
+ const doc: LoroDoc = new LoroDoc();
+ doc.getText("content").update("hello world 121");
+ doc.commit();
+ const snapshot = doc.export({ mode: "snapshot" });
+
+ let req = InitializeFromSnapshotRequest.encode({
+ snapshot: snapshot,
+ });
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/initialize",
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/octet-stream",
+ Authorization: "Bearer " + token,
+ },
+ body: req,
+ },
+ );
+ let user = await createTestUser(mf, "test-doc");
+ expect(user.getState()).toBe("hello world 121");
+ });
+
+ test("should reject snapshot if already exists", async () => {
+ const doc: LoroDoc = new LoroDoc();
+ doc.getText("content").update("hello world 121");
+ doc.commit();
+
+ const snapshot = doc.export({ mode: "snapshot" });
+
+ const req = InitializeFromSnapshotRequest.encode({
+ snapshot: snapshot,
+ });
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ let firstResponse = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/initialize",
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/octet-stream",
+ Authorization: "Bearer " + token,
+ },
+ body: req,
+ },
+ );
+
+ expect(firstResponse.status).toBe(200);
+
+ doc.getText("content").update("hello world 222");
+ doc.commit();
+
+ const snapshot2 = doc.export({ mode: "snapshot" });
+
+ let response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/initialize",
+ {
+ method: "POST",
+ headers: {
+ Authorization: "Bearer " + token,
+ "Content-Type": "application/octet-stream",
+ },
+ body: InitializeFromSnapshotRequest.encode({
+ snapshot: snapshot2,
+ }),
+ },
+ );
+
+ expect(response.status).toBe(500);
+
+ let user = await createTestUser(mf, "test-doc");
+
+ expect(user.getState()).toBe("hello world 121");
+ });
+
+ test("should fetch correct metadata about document", async () => {
+ const userA = await createTestUser(mf, "test-doc");
+ const userB = await createTestUser(mf, "test-doc");
+
+ const peeridA = userA.doc.peerIdStr;
+ const peeridB = userB.doc.peerIdStr;
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ const metadata = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ },
+ );
+
+ const json = (await metadata.json()) as {
+ id: string;
+ peers: Array<{
+ peer_id: string;
+ user_id: string;
+ }>;
+ version_id: string;
+ };
+
+ expect(json.id).toBe("test-doc");
+ expect(json.peers.length).toBe(2);
+ expect(json.version_id).toBe("");
+
+ expect(json.peers.find((p) => p.peer_id == peeridA)).toBeTruthy();
+ expect(json.peers.find((p) => p.peer_id == peeridB)).toBeTruthy();
+ });
+
+ test("should increment document version id counter", async () => {
+ const userA = await createTestUser(mf, "test-doc");
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+ const version_id_og: number = (await (await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ },
+ )).json()).version_id;
+
+ userA.makeChange("hello world 123");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ userA.connection.getWebSocket().close();
+ await new Promise((resolve) => setTimeout(resolve, 5000));
+
+ const version_id: number = (await (await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ },
+ )).json()).version_id;
+
+ expect(version_id != version_id_og).toBe(true);
+ }, 6000);
+
+ test("should copy document to new location", async () => {
+ const userA = await createTestUser(mf, "test-doc");
+ userA.makeChange("hello world 123");
+
+ // give document a change to save the snapshot
+ await new Promise((resolve) => setTimeout(resolve, 5000));
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/copy",
+ {
+ method: "POST",
+ body: JSON.stringify({
+ target_document_id: "test-doc-copy",
+ }),
+ headers: {
+ "x-internal-auth-key": "local",
+ "Content-Type": "application/json",
+ },
+ },
+ );
+
+ expect(response.status).toBe(200);
+
+ const userB = await createTestUser(mf, "test-doc-copy");
+
+ expect(userB.getState()).toBe("hello world 123");
+ }, 10000);
+
+ test("should copy document to new location with specific version", async () => {
+ const userA = await createTestUser(mf, "test-doc");
+ userA.makeChange("v1");
+
+ const frontier = userA.doc.vvToFrontiers(userA.doc.version())[0];
+
+ userA.makeChange("v2");
+
+ await new Promise((resolve) => setTimeout(resolve, 5000));
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/copy",
+ {
+ method: "POST",
+ body: JSON.stringify({
+ target_document_id: "test-doc-copy",
+ version_id: {
+ peer: frontier.peer,
+ counter: frontier.counter,
+ },
+ }),
+ headers: {
+ "x-internal-auth-key": "local",
+ "Content-Type": "application/json",
+ },
+ },
+ );
+
+ expect(response.status).toBe(200);
+
+ const userB = await createTestUser(mf, "test-doc-copy");
+
+ expect(userB.getState()).toBe("v1");
+ }, 10000);
+});
diff --git a/rust/sync-service/tests/document_sync.test.ts b/rust/sync-service/tests/document_sync.test.ts
new file mode 100644
index 0000000000..822ee24b6a
--- /dev/null
+++ b/rust/sync-service/tests/document_sync.test.ts
@@ -0,0 +1,191 @@
+import { Miniflare } from "miniflare";
+import { LoroDoc } from "loro-crdt";
+import { FromRemote, FromPeer } from "../bebop/generated/schema";
+import { expect, test, describe, beforeAll, assert } from "vitest";
+import {
+ connectToDocumentForTesting,
+ createTestUser,
+ setupMiniflare,
+ createDocument,
+} from "./utils";
+
+let mf: Miniflare;
+
+beforeAll(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("document sync tests", () => {
+ test("should be healthy", async () => {
+ const response = await mf.dispatchFetch("http://localhost:8087/health");
+ expect(response.status).toBe(200);
+ expect(await response.text()).toBe("healthy");
+ });
+
+ test("should receive initial sync on connect", async () => {
+ const ws = await connectToDocumentForTesting(mf, "test");
+ const next = await ws.waitForNextMessage();
+ expect(next instanceof ArrayBuffer);
+
+ const message = FromRemote.decode(new Uint8Array(next));
+ expect(message.isRemoteInitialSync()).toBe(true);
+ });
+
+ test("should be able to load initial sync into loro", async () => {
+ const ws = await connectToDocumentForTesting(mf, "test");
+ const next = await ws.waitForNextMessage();
+ expect(next instanceof ArrayBuffer);
+
+ const message = FromRemote.decode(new Uint8Array(next));
+ assert(message.isRemoteInitialSync());
+ const loroDoc = new LoroDoc();
+ let status = loroDoc.import(message.value.snapshot);
+ assert(Object.entries(status.pending ?? {})?.length === 0);
+ });
+
+ test("changes should transmit between users", async () => {
+ const wsA = await connectToDocumentForTesting(mf, "test");
+ const wsB = await connectToDocumentForTesting(mf, "test");
+ const next = await wsA.waitForNextMessage();
+ expect(next instanceof ArrayBuffer);
+
+ const message = FromRemote.decode(new Uint8Array(next));
+ const loroDoc = new LoroDoc();
+ assert(message.isRemoteInitialSync());
+ loroDoc.import(message.value.snapshot);
+
+ loroDoc.getText("content").push("hello world");
+ loroDoc.commit();
+
+ let update = loroDoc.export({ mode: "update" });
+
+ wsA.send(
+ FromPeer.fromPeerUpdate({
+ update: update,
+ }).encode(),
+ );
+
+ const bFirstMessage = await wsB.waitForNextMessage();
+ const bSecondMessage = await wsB.waitForNextMessage();
+
+ let bInitialSync = FromRemote.decode(new Uint8Array(bFirstMessage));
+ assert(bInitialSync.isRemoteInitialSync());
+ let bSync = FromRemote.decode(new Uint8Array(bSecondMessage));
+ assert(bSync.isRemoteUpdate());
+
+ const loroDocB = new LoroDoc();
+ loroDocB.import(bInitialSync.value.snapshot);
+ loroDocB.import(bSync.value.update);
+ expect(loroDocB.getText("content").toString()).toBe("hello world");
+ });
+
+ test("user connecting in middle of sync should receive all changes", async () => {
+ const userA = await createTestUser(mf, "1234");
+ expect(userA.getState()).toBe("");
+ const userB = await createTestUser(mf, "1234");
+ const userC = await createTestUser(mf, "1234");
+ userA.makeChange("hello world");
+ userB.import(await userB.readSyncMessage());
+ userC.import(await userC.readSyncMessage());
+
+ expect(userA.getState()).toBe("hello world");
+ expect(userB.getState()).toBe("hello world");
+ expect(userC.getState()).toBe("hello world");
+
+ userB.makeChange(" goodbye world");
+ userA.import(await userA.readSyncMessage());
+ userC.import(await userC.readSyncMessage());
+
+ expect(userA.getState()).toBe("hello world goodbye world");
+ expect(userB.getState()).toBe("hello world goodbye world");
+ expect(userC.getState()).toBe("hello world goodbye world");
+
+ userB.makeChange(" hello again world");
+ const userD = await createTestUser(mf, "1234");
+
+ expect(userD.getState()).toBe(
+ "hello world goodbye world hello again world",
+ );
+ });
+
+ test("re-importing same update has no affect", async () => {
+ const userA = await createTestUser(mf, "12345");
+ const userB = await createTestUser(mf, "12345");
+ userA.makeChange("hello world");
+ let userBMessage = await userB.readSyncMessage();
+ userB.import(userBMessage);
+ userB.import(userBMessage);
+ expect(userA.getState()).toBe("hello world");
+ expect(userB.getState()).toBe("hello world");
+ });
+
+ test("batch importing works", async () => {
+ const userA = await createTestUser(mf, "12346");
+ const userB = await createTestUser(mf, "12346");
+ userA.makeChange("hello world");
+ let userBMessage = await userB.readSyncMessage();
+ userA.makeChange(" goodbye world");
+ let userBMessage2 = await userB.readSyncMessage();
+ userA.batchImport([userBMessage, userBMessage2]);
+ userB.batchImport([userBMessage, userBMessage2]);
+ // double check that double importing doesn't do anything
+ userB.batchImport([userBMessage, userBMessage2]);
+ expect(userB.getState()).toBe("hello world goodbye world");
+ });
+
+ test("non-text based exampe", async () => {
+ const docA = new LoroDoc();
+ const connectionA = await connectToDocumentForTesting(mf, "12347");
+
+ const docB = new LoroDoc();
+ const connectionB = await connectToDocumentForTesting(mf, "12347");
+ connectionB.waitForNextMessage();
+
+ let tree = docA.getTree("tree");
+
+ for (let i = 0; i < 10; i++) {
+ let node = tree.createNode(undefined, i);
+ node.data.set("test", i);
+ }
+
+ docA.commit();
+ connectionA.send(
+ FromPeer.fromPeerUpdate({
+ update: docA.export({ mode: "update" }),
+ }).encode(),
+ );
+
+ let meessage = await connectionB.waitForNextMessage();
+ const sync = FromRemote.decode(new Uint8Array(meessage));
+ assert(sync.isRemoteUpdate());
+ docB.import(sync.value.update);
+
+ expect(docB.toJSON()).toStrictEqual(docA.toJSON());
+ });
+
+ test("document state persists after 15 second timeout", async () => {
+ let doc = await createDocument(mf);
+ let [userA, userB] = await doc.createMultipleUsers(2);
+
+ userA.makeChange("hello world");
+ userB.import(await userB.readSyncMessage());
+ userB.makeChange(" goodbye world");
+ userA.import(await userA.readSyncMessage());
+
+ expect(userA.getState()).toBe("hello world goodbye world");
+ expect(userB.getState()).toBe("hello world goodbye world");
+
+ await new Promise((resolve) => setTimeout(resolve, 15000));
+
+ const userC = await doc.createUser();
+ expect(userC.getState()).toBe("hello world goodbye world");
+ }, 30000);
+
+ test("user gets remote update-ack", async () => {
+ let doc = await createDocument(mf);
+ let userA = await doc.createUser();
+ userA.makeChange("hello world");
+ expect(userA.getState()).toBe("hello world");
+ expect((await userA.readNextMessage()).isRemoteUpdateAck()).toBeTruthy();
+ }, 30000);
+});
diff --git a/rust/sync-service/tests/metadata_endpoint.test.ts b/rust/sync-service/tests/metadata_endpoint.test.ts
new file mode 100644
index 0000000000..da8cf3a463
--- /dev/null
+++ b/rust/sync-service/tests/metadata_endpoint.test.ts
@@ -0,0 +1,245 @@
+import { Miniflare } from "miniflare";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("metadata endpoint tests", async () => {
+ const make_user = async (opts) => {
+ opts.documentId ??= 'test-doc';
+ opts.permissionLevel ??= "owner";
+ const user = await createTestUser(mf, opts.documentId, opts);
+ return { user, opts }
+ };
+ const get_metadata = async (opts) => {
+ const { documentId, userId, permissionLevel } = opts;
+ const token = getTokenForDocument(opts.documentId, opts.userId, opts.permissionLevel);
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+ expect(response.status).toBe(200);
+ const metadata = await response.json() as {
+ id: string;
+ peers: Array<{
+ peer_id: string;
+ user_id: string;
+ }>;
+ version_id: string;
+ };
+ return metadata;
+ }
+
+ test("should return correct metadata for document with single user", async () => {
+ // Create a document with one user
+ const {user, opts} = await make_user({ userId: 'single-user' });
+ user.makeChange("Single user content");
+
+ // Wait for the change to be processed
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ const metadata = await get_metadata(opts);
+ expect(metadata.id).toBe("test-doc");
+ expect(metadata.peers.length).toBe(1);
+ expect(metadata.peers[0].peer_id).toBe(user.doc.peerIdStr);
+ expect(metadata.peers[0].user_id).toBe("single-user");
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return metadata for document with multiple users", async () => {
+ // Create document with multiple users
+ const {user: userA, opts: optsA } = await make_user({ userId: 'user-a' });
+ const {user: userB, opts: optsB } = await make_user({ userId: 'user-b' });
+ const {user: userC, opts: optsC } = await make_user({ userId: 'user-c' });
+
+ userA.makeChange("Change from user A");
+ userB.makeChange(" - Change from user B");
+ userC.makeChange(" - Change from user C");
+
+ // Wait for changes to be processed
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const metadata = await get_metadata(optsA);
+
+ expect(metadata.id).toBe("test-doc");
+ expect(metadata.peers.length).toBe(3);
+
+ // Verify all users are present
+ const userIds = metadata.peers.map(p => p.user_id).sort();
+ expect(userIds).toEqual(["user-a", "user-b", "user-c"]);
+
+ // Verify peer IDs match
+ const peerIds = metadata.peers.map(p => p.peer_id).sort();
+ const expectedPeerIds = [
+ userA.doc.peerIdStr,
+ userB.doc.peerIdStr,
+ userC.doc.peerIdStr
+ ].sort();
+ expect(peerIds).toEqual(expectedPeerIds);
+
+ // Clean up connections
+ userA.connection.getWebSocket().close();
+ userB.connection.getWebSocket().close();
+ userC.connection.getWebSocket().close();
+ });
+
+ test("should increment version ID after document changes and disconnect", async () => {
+ let { user, opts } = await make_user({ userId: 'version-test-user'});
+ //const user = await createTestUser(mf, "test-doc", { userId: "version-test-user" });
+ //const { user, doc_name, opts } = make_user('test-doc', {
+ let metadata_og = await get_metadata(opts);
+ user.makeChange("Initial content for version test");
+
+ // Wait and disconnect to trigger version increment
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ user.connection.getWebSocket().close();
+
+ // Wait for disconnect processing and version increment
+ await new Promise((resolve) => setTimeout(resolve, 5000));
+
+ let metadata = await get_metadata(opts);
+
+ expect(metadata_og.version_id).toBe("");
+ expect(metadata.version_id != metadata_og.version_id).toBe(true);
+ }, 8000);
+
+ test("should handle different permission levels in metadata", async () => {
+ // Create users with different permission levels
+ const owner = await createTestUser(mf, "test-doc", {
+ userId: "owner-user",
+ permissionLevel: "owner"
+ });
+ const editor = await createTestUser(mf, "test-doc", {
+ userId: "editor-user",
+ permissionLevel: "edit"
+ });
+ const viewer = await createTestUser(mf, "test-doc", {
+ userId: "viewer-user",
+ permissionLevel: "view"
+ });
+
+ owner.makeChange("Content from owner");
+ editor.makeChange(" - Edit from editor");
+
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const token = getTokenForDocument("test-doc", "owner-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const metadata = await response.json() as {
+ id: string;
+ peers: Array<{
+ peer_id: string;
+ user_id: string;
+ }>;
+ version_id: string;
+ };
+
+ expect(metadata.peers.length).toBe(3);
+
+ // All users should be present regardless of permission level
+ const userIds = metadata.peers.map(p => p.user_id).sort();
+ expect(userIds).toEqual(["editor-user", "owner-user", "viewer-user"]);
+
+ owner.connection.getWebSocket().close();
+ editor.connection.getWebSocket().close();
+ viewer.connection.getWebSocket().close();
+ });
+
+ test("should require authentication for metadata endpoint", async () => {
+ // Create document
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Protected metadata");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Try to fetch without token
+ const responseWithoutAuth = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata"
+ );
+
+ expect(responseWithoutAuth.status).toBe(401);
+
+ // Try with invalid token
+ const responseWithBadToken = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer invalid-token",
+ },
+ }
+ );
+
+ expect(responseWithBadToken.status).toBe(401);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return 404 for non-existent document metadata", async () => {
+ const token = getTokenForDocument("non-existent-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/non-existent-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+ console.log(await response.text());
+
+ expect(response.status).toBe(404);
+ });
+
+ test("empty document with one peer", async () => {
+ const token = getTokenForDocument("empty-doc", "test-user", "owner");
+
+ const tempUser = await createTestUser(mf, "empty-doc");
+ tempUser.connection.getWebSocket().close();
+
+ await new Promise((resolve) => setTimeout(resolve, 500));
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/empty-doc/metadata",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const metadata = await response.json() as {
+ id: string;
+ peers: Array<{
+ peer_id: string;
+ user_id: string;
+ }>;
+ version_id: string;
+ };
+
+ expect(metadata.id).toBe("empty-doc");
+ expect(metadata.peers.length).toBe(1);
+ expect(metadata.version_id).toBe("");
+ }, 3000);
+});
diff --git a/rust/sync-service/tests/permissions.test.ts b/rust/sync-service/tests/permissions.test.ts
new file mode 100644
index 0000000000..f8736c1dd8
--- /dev/null
+++ b/rust/sync-service/tests/permissions.test.ts
@@ -0,0 +1,102 @@
+import { Miniflare } from "miniflare";
+import { test, describe, beforeAll, expect } from "vitest";
+import {
+ connectToDocumentForTesting,
+ createTestUser,
+ setupMiniflare,
+} from "./utils";
+import { FromPeer, FromRemote } from "../bebop/generated/schema";
+
+let mf: Miniflare;
+
+beforeAll(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("should respect permissions", () => {
+ test("should not allow view only user to push updates", async () => {
+ const userA = await createTestUser(mf, "test", {
+ userId: "view-only-user",
+ permissionLevel: "view",
+ });
+
+ userA.makeChange("hello world");
+
+ await new Promise((resolve) => setTimeout(resolve, 300));
+
+ const userB = await createTestUser(mf, "test");
+ const userC = await createTestUser(mf, "test", {
+ userId: "view-only-user-c",
+ permissionLevel: "view",
+ });
+
+ expect(userB.getState()).toBe("");
+
+ userB.makeChange("hello world");
+
+ await new Promise((resolve) => setTimeout(resolve, 300));
+
+ expect(userB.getState()).toBe("hello world");
+
+ // User c should still be receiving updates from user a
+ let update = await userC.readSyncMessage();
+ userC.import(update);
+ expect(userC.getState()).toBe("hello world");
+ });
+
+ test("should allow all users with a token to connect", async () => {
+ expect(
+ async () => await connectToDocumentForTesting(mf, "test", {
+ userId: "view-only-user",
+ permissionLevel: "view",
+ }),
+ ).not.toThrow();
+ expect(
+ async () => await connectToDocumentForTesting(mf, "test", {
+ userId: "comment-user",
+ permissionLevel: "comment",
+ }),
+ ).not.toThrow();
+ expect(
+ async () => await connectToDocumentForTesting(mf, "test", {
+ userId: "edit-user",
+ permissionLevel: "edit",
+ }),
+ ).not.toThrow();
+ expect(
+ async () => await connectToDocumentForTesting(mf, "test", {
+ userId: "owner-user",
+ permissionLevel: "owner",
+ }),
+ ).not.toThrow();
+ });
+
+ test("should allow view only user to push awareness", async () => {
+ const userA = await createTestUser(mf, "test", {
+ userId: "view-only-user",
+ permissionLevel: "view",
+ });
+
+ const userB = await createTestUser(mf, "test");
+
+ userA.awareness.set(userA.doc.peerIdStr, {
+ name: "test",
+ });
+
+ let awarenessUpdate = userA.awareness.encode(userA.doc.peerIdStr);
+
+ userA.connection.send(
+ FromPeer.fromPeerAwareness({ awareness: awarenessUpdate }).encode(),
+ );
+
+ let message = await userB.waitForNextMessage();
+
+ let remoteAwareness = FromRemote.decode(new Uint8Array(message));
+
+ expect(remoteAwareness.isRemoteAwareness()).toBe(true);
+
+ userB.awareness.apply((remoteAwareness.value as any).awareness);
+
+ expect(userB.awareness.getAllStates()[userA.doc.peerIdStr]).toBeDefined();
+ });
+});
diff --git a/rust/sync-service/tests/raw_endpoint.test.ts b/rust/sync-service/tests/raw_endpoint.test.ts
new file mode 100644
index 0000000000..a74d663803
--- /dev/null
+++ b/rust/sync-service/tests/raw_endpoint.test.ts
@@ -0,0 +1,123 @@
+import { Miniflare } from "miniflare";
+import { LoroDoc } from "loro-crdt";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("raw endpoint tests", async () => {
+ test("should create document and fetch via raw endpoint", async () => {
+ // Create a document with some content
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Hello world from raw endpoint test!");
+
+ // Wait for the change to be processed
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Get token for API access
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch document via raw endpoint
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/raw",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ // Parse the response - should be JSON containing the document data
+ const rawData = await response.json();
+
+ // Verify the response contains expected structure
+ expect(rawData).toBeDefined();
+ expect(typeof rawData).toBe("object");
+
+ // Clean up
+ user.connection.getWebSocket().close();
+ });
+
+ test("should fetch raw data for document with multiple changes", async () => {
+ // Create document and make multiple changes
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("First change");
+ user.makeChange(" - Second change");
+ user.makeChange(" - Third change");
+
+ // Wait for changes to be processed
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch raw data
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/raw",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const rawData = await response.json();
+ expect(rawData).toBeDefined();
+
+ // Verify document state matches what we expect
+ expect(user.getState()).toBe("First change - Second change - Third change");
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should require authentication for raw endpoint", async () => {
+ // Create document
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Protected content");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Try to fetch without token
+ const responseWithoutAuth = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/raw"
+ );
+
+ expect(responseWithoutAuth.status).toBe(401);
+
+ // Try with invalid token
+ const responseWithBadToken = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/raw",
+ {
+ headers: {
+ Authorization: "Bearer invalid-token",
+ },
+ }
+ );
+
+ expect(responseWithBadToken.status).toBe(401);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return 404 for non-existent document", async () => {
+ const token = getTokenForDocument("non-existent-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/non-existent-doc/raw",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(404);
+ });
+});
diff --git a/rust/sync-service/tests/snapshot_endpoint.test.ts b/rust/sync-service/tests/snapshot_endpoint.test.ts
new file mode 100644
index 0000000000..41b1b855e0
--- /dev/null
+++ b/rust/sync-service/tests/snapshot_endpoint.test.ts
@@ -0,0 +1,126 @@
+import { Miniflare } from "miniflare";
+import { LoroDoc } from "loro-crdt";
+import { expect, test, describe, beforeEach } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+const l = (...x) => [x[0], console.log(...x)][0];
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("snapshot endpoint tests", async () => {
+ test("should create document and fetch via snapshot endpoint", async () => {
+ // Create a document with some content
+ const user = await createTestUser(mf, "test-doc");
+ const HELLO_MSG = 'hello world test snapshots';
+ user.makeChange(HELLO_MSG);
+
+ // Wait for the change to be processed
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Get token for API access
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch document via raw endpoint
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/snapshot",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+
+ const rawData = await response.arrayBuffer();
+ let doc = new LoroDoc();
+ doc.import(Buffer.from(rawData));
+ expect(l(doc.getText('content').toString()), HELLO_MSG);
+
+ // Clean up
+ user.connection.getWebSocket().close();
+ });
+
+ test("should fetch snapshot for document with multiple changes", async () => {
+ // Create document and make multiple changes
+ const user = await createTestUser(mf, "test-doc");
+ let changes = [
+ "First change",
+ " - Second change",
+ " - Third change",
+ ];
+ user.makeChange(changes[0]);
+ user.makeChange(changes[1]);
+ user.makeChange(changes[2]);
+
+ // Wait for changes to be processed
+ await new Promise((resolve) => setTimeout(resolve, 200));
+
+ const token = getTokenForDocument("test-doc", "test-user", "owner");
+
+ // Fetch raw data
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/snapshot",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ const rawData = await response.arrayBuffer();
+ let doc = new LoroDoc();
+ doc.import(Buffer.from(rawData));
+ expect(l(doc.getText('content').toString()), changes.join(''));
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should require authentication for snapshot endpoint", async () => {
+ // Create document
+ const user = await createTestUser(mf, "test-doc");
+ user.makeChange("Protected content");
+
+ await new Promise((resolve) => setTimeout(resolve, 100));
+
+ // Try to fetch without token
+ const responseWithoutAuth = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/snapshot"
+ );
+
+ expect(responseWithoutAuth.status).toBe(401);
+
+ // Try with invalid token
+ const responseWithBadToken = await mf.dispatchFetch(
+ "http://localhost:8787/document/test-doc/snapshot",
+ {
+ headers: {
+ Authorization: "Bearer invalid-token",
+ },
+ }
+ );
+
+ expect(responseWithBadToken.status).toBe(401);
+
+ user.connection.getWebSocket().close();
+ });
+
+ test("should return 404 for non-existent document", async () => {
+ const token = getTokenForDocument("non-existent-doc", "test-user", "owner");
+
+ const response = await mf.dispatchFetch(
+ "http://localhost:8787/document/non-existent-doc/snapshot",
+ {
+ headers: {
+ Authorization: "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(404);
+ });
+});
diff --git a/rust/sync-service/tests/user_peer.test.ts b/rust/sync-service/tests/user_peer.test.ts
new file mode 100644
index 0000000000..8e1587a96c
--- /dev/null
+++ b/rust/sync-service/tests/user_peer.test.ts
@@ -0,0 +1,33 @@
+import { Miniflare } from "miniflare";
+import { test, describe, beforeAll, expect } from "vitest";
+import { createTestUser, getTokenForDocument, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeAll(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("user to peer ID association tests", () => {
+ test("should store user id to peer id mapping", async () => {
+ const wsA = await createTestUser(mf, "test");
+
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+
+ const token = getTokenForDocument("test", "test-user", "owner");
+
+ let response = await mf.dispatchFetch(
+ `http://localhost:8787/document/test/peer/${wsA.doc.peerId}`,
+ {
+ headers: {
+ "Authorization": "Bearer " + token,
+ },
+ }
+ );
+
+ expect(response.status).toBe(200);
+ let json = (await response.json()) as { peer_id: string; user_id: string };
+ expect(json.peer_id).toBe(wsA.doc.peerIdStr);
+ expect(json.user_id).toBe("test-user");
+ });
+});
diff --git a/rust/sync-service/tests/utils.ts b/rust/sync-service/tests/utils.ts
new file mode 100644
index 0000000000..e8626676af
--- /dev/null
+++ b/rust/sync-service/tests/utils.ts
@@ -0,0 +1,286 @@
+import { EphemeralStore, LoroDoc } from 'loro-crdt';
+import { Miniflare, type WebSocket } from 'miniflare';
+import { assert } from 'vitest';
+import jwt from 'jsonwebtoken';
+import {
+ FromRemote,
+ FromPeer,
+} from '../bebop/generated/schema';
+import fs from 'node:fs';
+import { verify } from 'node:crypto';
+
+export const INTERNAL_API_SECRET = 'local';
+
+export const log = (...x) => [console.log(...x), x[0]][1]
+export const sleep = (millis) => new Promise(resolve => setTimeout(resolve, millis));
+
+async function migrateDatabase(mf: Miniflare) {
+ const db = await mf.getD1Database("USER_PEER_MAPPING");
+ let migration = fs.readFileSync("database/user-peer-mapping/migrations/0001_add_users.sql").toString();
+ const stmt = db.prepare(migration);
+ await stmt.all();
+}
+
+export async function setupMiniflare() {
+ const mf = new Miniflare({
+ d1Databases: {
+ USER_PEER_MAPPING: 'user-peer-mapping-database-id',
+ },
+ scriptPath: "./build/worker/shim.mjs",
+ modules: true,
+ modulesRules: [
+ { type: "CompiledWasm", include: ["**/*.wasm"], fallthrough: true },
+ ],
+ durableObjects: {
+ DOCUMENT_SYNC_SESSION: { className: "DocumentSyncSession", useSQLite: true},
+ },
+ r2Buckets: {
+ DOCUMENT_SNAPSHOT_BUCKET: "document-snapshot-bucket",
+ },
+ kvNamespaces: {
+ DOCUMENT_VERSIONING_KV: "document-versioning-kv",
+ SNAPSHOT_STORE_KV: "snapshot-store-kv-test",
+ },
+ cachePersist: false,
+ workflowsPersist: false,
+ durableObjectsPersist: false,
+ bindings: {
+ DOCUMENT_PERMISSIONS_SECRET: "local",
+ INTERNAL_API_SECRET_KEY: "INTERNAL_API_SECRET",
+ INTERNAL_API_SECRET,
+ SPS_API_SECRET_KEY: "local",
+ SPS_URL:"http://localhost:8090",
+ local:true,
+ },
+ compatibilityDate: '2025-03-05'
+ });
+
+ migrateDatabase(mf);
+
+
+ return mf;
+}
+
+type UserOptions = {
+ userId: string;
+ permissionLevel?: 'view' | 'edit' | 'owner' | 'comment';
+};
+
+function randInt(maxNum) {
+ return Math.floor(Math.random() * maxNum)
+}
+function randName(length = 6) {
+ let out = '';
+ const alpha = 'abcdefghijklmnopqrstuvwxyz';
+ for (let i = 0; i < length; i++) {
+ out += alpha[randInt(alpha.length)]
+ }
+ return out
+}
+export function *range(max: number) {
+ for (let i = 0; i < max; i++) {
+ yield i;
+ }
+}
+
+export async function createDocument(mf: Miniflare, name = randName()) {
+ return {
+ name,
+ async createUser(options?: UserOptions) {
+ return await createTestUser(mf, name, options);
+ },
+ async createMultipleUsers(n_users: number, options?: UserOptions) {
+ let out = [];
+ for (let i of range(n_users)) {
+ let u = await this.createUser(options);
+ out.push(u);
+ }
+ return out;
+ },
+ async copy(targetId = randName(), versionId?: any) {
+ let response = await copyDocument(mf, name, targetId, versionId);
+ assert(response.status == 200);
+ return createDocument(mf, targetId);
+ }
+ }
+}
+
+export const copyDocument = (mf, sourceId: string, targetId: string, versionId?: any) => {
+ const body: any = { target_document_id: targetId };
+ if (versionId) {
+ body.version_id = versionId;
+ }
+
+ return mf.dispatchFetch(`http://localhost:8787/document/${sourceId}/copy`, {
+ method: "POST",
+ headers: {
+ "x-internal-auth-key": INTERNAL_API_SECRET,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(body),
+ });
+};
+
+export async function createTestUser(mf: Miniflare, documentId = 'test-doc', options?: UserOptions) {
+ let loroDoc = new LoroDoc();
+ let connection = await connectToDocumentForTesting(mf, documentId, options);
+ let awareness = new EphemeralStore(60000);
+
+ const message = await connection.waitForNextMessage();
+
+ const initialSync = FromRemote.decode(new Uint8Array(message));
+
+ assert(initialSync.isRemoteInitialSync());
+
+ loroDoc.import(initialSync.value.snapshot);
+
+ if (initialSync.value.awareness) {
+ awareness.apply(initialSync.value.awareness);
+ }
+
+ const registrationMessage = FromPeer.fromPeerRegisterId({ peerid: loroDoc.peerId }).encode();
+
+
+ connection.getWebSocket().send(registrationMessage);
+
+ return {
+ doc: loroDoc,
+ awareness,
+ connection,
+ import(update: Uint8Array) {
+ let status = loroDoc.import(update);
+ assert(Object.entries(status.pending ?? {})?.length === 0);
+ },
+ batchImport(updates: Uint8Array[]) {
+ loroDoc.importBatch(updates);
+ },
+ async readNextMessage() {
+ let message = await connection.waitForNextMessage();
+ return FromRemote.decode(new Uint8Array(message));
+ },
+ async readSyncMessage() {
+ let sync = await this.readNextMessage();
+ if (sync.isRemoteUpdateAck()) {
+ return this.readSyncMessage();
+ }
+ assert(sync.isRemoteUpdate());
+ return sync.value.update;
+ },
+ makeChange(text: string) {
+ loroDoc.getText('content').push(text);
+ loroDoc.commit();
+ const update = loroDoc.export({ mode: 'update' });
+ connection.send(FromPeer.fromPeerUpdate({ update}).encode());
+ },
+ getState() {
+ return loroDoc.getText('content').toString();
+ },
+ async importNextUpdate() {
+ let update = await this.readSyncMessage();
+ this.import(update);
+ },
+ async copyDocument(targetId = randName(), versionId?: any) {
+ const response = await copyDocument(mf, documentId, targetId, versionId);
+ assert(response.status == 200);
+ return createDocument(mf, targetId);
+
+ },
+ ...connection,
+ };
+}
+
+export function createTestWebSocket(ws: WebSocket) {
+ const messages: ArrayBuffer[] = [];
+ const waiters: ((message: ArrayBuffer) => void)[] = [];
+
+ ws.addEventListener('message', (event) => {
+ const message = event.data as ArrayBuffer;
+
+ if (waiters.length > 0) {
+ const resolve = waiters.shift()!;
+ resolve(message);
+ } else {
+ messages.push(message);
+ }
+ });
+
+ return {
+ async waitForNextMessage(timeout = 5000): Promise<ArrayBuffer | string> {
+ if (messages.length > 0) {
+ return messages.shift()!;
+ }
+
+ return new Promise<ArrayBuffer>((resolve, reject) => {
+ const timeoutId = setTimeout(() => {
+ const index = waiters.indexOf(resolve);
+ if (index !== -1) {
+ waiters.splice(index, 1);
+ }
+ reject(
+ new Error(
+ `Timed out waiting for WebSocket message after ${timeout}ms`
+ )
+ );
+ }, timeout);
+
+ const wrappedResolve = (message: ArrayBuffer) => {
+ clearTimeout(timeoutId);
+ resolve(message);
+ };
+
+ waiters.push(wrappedResolve);
+ });
+ },
+
+ send(message: string | ArrayBuffer) {
+ ws.send(message);
+ },
+
+ getWebSocket() {
+ return ws;
+ },
+ };
+}
+
+export function getTokenForDocument(
+ documentId: string,
+ userId: string,
+ permissionLevel: 'view' | 'edit' | 'owner'
+): string {
+ const token = jwt.sign({
+ user_id: userId,
+ document_id: documentId,
+ access_level: permissionLevel,
+ exp: Math.floor(Date.now() / 1000) + 60,
+ }, "local")
+
+ return token;
+}
+
+
+export async function connectToDocumentForTesting(
+ mf: Miniflare,
+ documentId: string,
+ options?: UserOptions
+) {
+ const token = getTokenForDocument(documentId, options?.userId ?? "test-user", options?.permissionLevel ?? "owner");
+
+ const response = await mf.dispatchFetch(
+ `http://localhost:8787/document/${documentId}/connect?token=${token}`,
+ {
+ headers: {
+ Upgrade: 'websocket',
+ },
+ }
+ );
+
+ const ws = response.webSocket;
+ if (!ws) {
+ throw new Error('Failed to establish WebSocket connection');
+ }
+ let wsWrapper = createTestWebSocket(ws);
+
+ ws.accept();
+
+ return wsWrapper;
+}
diff --git a/rust/sync-service/tests/websocket.test.ts b/rust/sync-service/tests/websocket.test.ts
new file mode 100644
index 0000000000..ec90873f68
--- /dev/null
+++ b/rust/sync-service/tests/websocket.test.ts
@@ -0,0 +1,25 @@
+import { Miniflare } from "miniflare";
+import { test, describe, beforeEach, expect } from "vitest";
+import { connectToDocumentForTesting, setupMiniflare } from "./utils";
+
+let mf: Miniflare;
+
+beforeEach(async () => {
+ mf = await setupMiniflare();
+});
+
+describe("websocket tests", async () => {
+ test("should respond to ping with pong", async () => {
+
+ const ws = await connectToDocumentForTesting(mf, "test-ping");
+
+ // drain the initial sync message
+ await ws.waitForNextMessage();
+
+ ws.send("ping");
+
+ let maybePong = await ws.waitForNextMessage();
+
+ expect(maybePong.toString().trim()).toBe("pong");
+ });
+});
diff --git a/rust/sync-service/wrangler.toml b/rust/sync-service/wrangler.toml
new file mode 100644
index 0000000000..f33751d843
--- /dev/null
+++ b/rust/sync-service/wrangler.toml
@@ -0,0 +1,120 @@
+name = "sync_service2"
+main = "build/worker/shim.mjs"
+compatibility_date = "2025-03-05"
+
+[build]
+command = "cargo install -q worker-build && worker-build --release"
+
+[observability.logs]
+enabled = true
+
+[observability.traces]
+enabled = true
+head_sampling_rate = 1
+persist = true
+
+# DEFAULT ENV -- Used in Local Development & Debugging Remote
+[[d1_databases]]
+binding = "USER_PEER_MAPPING"
+migrations_dir = "./database/user-peer-mapping/migrations/"
+database_name = "user-peer-mapping"
+database_id = "85b0ffef-e625-4b67-8b3b-77f33fd38fd3"
+
+[durable_objects]
+bindings = [
+ { name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
+]
+
+[[r2_buckets]]
+binding = "DOCUMENT_SNAPSHOT_BUCKET"
+bucket_name = "document-snapshot-bucket-dev"
+
+[vars]
+INTERNAL_API_SECRET_KEY = "LOCAL_API_KEY"
+SPS_URL = "https://search-processing-dev.macro.com"
+
+[[kv_namespaces]]
+binding = "DOCUMENT_VERSIONING_KV"
+id = "3548ca6265c745e38cd504194aa6e887"
+
+[[kv_namespaces]]
+binding = "SNAPSHOT_STORE_KV"
+id = "9beead2b7891492f82153d2354e64e92"
+
+[[migrations]]
+tag = "v1"
+new_sqlite_classes = ["DocumentSyncSession"]
+
+# DEVELOPMENT ENV - Used in development environment
+[env.dev]
+name = "sync-service-dev3"
+
+[env.dev.vars]
+INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_DEV"
+ENVIRONMENT = "development"
+SPS_URL = "https://search-processing-dev.macro.com"
+
+[env.dev.durable_objects]
+bindings = [
+ { name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
+]
+
+[[env.dev.r2_buckets]]
+binding = "DOCUMENT_SNAPSHOT_BUCKET"
+bucket_name = "document-snapshot-bucket-dev"
+
+[[env.dev.d1_databases]]
+binding = "USER_PEER_MAPPING"
+migrations_dir = "./database/user-peer-mapping/migrations/"
+database_name = "user-peer-mapping-dev"
+database_id = "687d123e-611e-4921-be72-a20913a068ff"
+
+[[env.dev.kv_namespaces]]
+binding = "DOCUMENT_VERSIONING_KV"
+id = "3548ca6265c745e38cd504194aa6e887"
+
+[[env.dev.kv_namespaces]]
+binding = "SNAPSHOT_STORE_KV"
+id = "9beead2b7891492f82153d2354e64e92"
+
+[[env.dev.migrations]]
+tag = "v1"
+new_sqlite_classes = ["DocumentSyncSession"]
+
+
+# PRODUDCTION ENV - Used in production environment
+[env.prod]
+name = "sync-service-prod2"
+
+[env.prod.vars]
+INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_PROD"
+ENVIRONMENT = "production"
+SPS_URL = "https://search-processing.macro.com"
+
+[env.prod.durable_objects]
+bindings = [
+ { name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
+]
+
+[[env.prod.r2_buckets]]
+binding = "DOCUMENT_SNAPSHOT_BUCKET"
+bucket_name = "document-snapshot-bucket-prod"
+
+[[env.prod.d1_databases]]
+binding = "USER_PEER_MAPPING"
+migrations_dir = "./database/user-peer-mapping/migrations/"
+database_name = "user-peer-mapping-prod"
+database_id = "cbe1e7d9-90bc-450a-a1fb-ade93f0b1074"
+
+[[env.prod.migrations]]
+tag = "v1"
+new_sqlite_classes = ["DocumentSyncSession"]
+
+[[env.prod.kv_namespaces]]
+binding = "DOCUMENT_VERSIONING_KV"
+id = "1e4c79d4265e40f08f9bfcb4c985c6d0"
+
+[[env.prod.kv_namespaces]]
+binding = "SNAPSHOT_STORE_KV"
+id = "50a128e2f8aa4357938fdb0ed0d629c5"
+