@rbxts/scribe 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  ```toml
9
9
  # wally.toml
10
10
  [dependencies]
11
- Scribe = "ericplane/scribe@2.6.1"
11
+ Scribe = "ericplane/scribe@2.7.0"
12
12
  ```
13
13
 
14
14
  roblox-ts users install `@rbxts/scribe` from npm (`npm install @rbxts/scribe`), with
@@ -1 +1 @@
1
- {"version":"2.6.1","format":1,"description":"Segments are [packedLine, sourceLine]. Use the last segment at or before the packed line, then add its line offset.","files":{"src/Client/DebugHook.luau":{"sourceSha256":"c382ebae369a4b32ebd93adb914e0414e481d170bf117caf24ba322e272b58d4","packedSha256":"c382ebae369a4b32ebd93adb914e0414e481d170bf117caf24ba322e272b58d4","segments":[[1,1]],"packagePath":"src/Client/DebugHook.luau"},"src/Client/init.luau":{"sourceSha256":"763e07a373832e9757fbb701a7ff801803b856912811a9086fa9c186c744c301","packedSha256":"c6cafbc88beaca6623af73b2c77b5f19bb5e5ba22eb5dabd99ff040dfcb592f5","segments":[[1,1],[543,556],[545,566],[550,588],[660,718],[665,744],[679,768],[696,793],[702,808],[705,819],[710,833],[713,849],[724,869],[726,883],[751,918],[765,946],[854,1045],[1185,1393],[1196,1413],[1203,1430],[1237,1474],[1244,1492],[1283,1541],[1307,1574],[1315,1595],[1321,1632],[1348,1670],[1377,1708],[1387,1725],[1397,1748],[1464,1828],[1506,1879],[1524,1905],[1526,1918],[1534,1948],[1539,1965]],"packagePath":"src/Client/init.luau"},"src/Internal/Addons.luau":{"sourceSha256":"35b63237bb0f1b1a6779b70ff67a3618afa2afe9eca058ddf7a3510044feab20","packedSha256":"35b63237bb0f1b1a6779b70ff67a3618afa2afe9eca058ddf7a3510044feab20","segments":[[1,1]],"packagePath":"src/Internal/Addons.luau"},"src/Internal/Big.luau":{"sourceSha256":"43327411937bc2af0fd7db8291681850939577ce8522a3f585db56cb7592da7e","packedSha256":"8ee726412bd9513da1eeea4655cec19c62e020a0c09fd263960244d7b74e6eb8","segments":[[1,1],[434,443],[439,456],[444,470],[449,484],[454,496],[461,513],[466,527],[558,666],[567,694],[572,719],[577,745],[582,774]],"packagePath":"src/Internal/Big.luau"},"src/Internal/Budget.luau":{"sourceSha256":"8a0f85b03ba48e4915536039d33f29739f5e3fc47a8d9af8a7d51fc8f865aab3","packedSha256":"8a0f85b03ba48e4915536039d33f29739f5e3fc47a8d9af8a7d51fc8f865aab3","segments":[[1,1]],"packagePath":"src/Internal/Budget.luau"},"src/Internal/Clock.luau":{"sourceSha256":"c0f81c8042945b97b28aa67146bb75276bf781bbf7ee5f1e98c99f20de912f17","packedSha256":"c0f81c8042945b97b28aa67146bb75276bf781bbf7ee5f1e98c99f20de912f17","segments":[[1,1]],"packagePath":"src/Internal/Clock.luau"},"src/Internal/Config.luau":{"sourceSha256":"1e76048f1f1ab3cb477ddb194ec5689f6d0b8ac6acdb48ea992d5e810944d373","packedSha256":"1e76048f1f1ab3cb477ddb194ec5689f6d0b8ac6acdb48ea992d5e810944d373","segments":[[1,1]],"packagePath":"src/Internal/Config.luau"},"src/Internal/Conform.luau":{"sourceSha256":"9ca454cda7d264b35090a91b74bbedc042a0abea334fa87f36a41c34476021ee","packedSha256":"9ca454cda7d264b35090a91b74bbedc042a0abea334fa87f36a41c34476021ee","segments":[[1,1]],"packagePath":"src/Internal/Conform.luau"},"src/Internal/Datatypes.luau":{"sourceSha256":"ffc6ef66d28c04fa4bd132ff330a83e8e10f343cf9ce6c88fdb1f095d0fec938","packedSha256":"ffc6ef66d28c04fa4bd132ff330a83e8e10f343cf9ce6c88fdb1f095d0fec938","segments":[[1,1]],"packagePath":"src/Internal/Datatypes.luau"},"src/Internal/Defaults.luau":{"sourceSha256":"c44cead5f97e28f708d73c37ad56426f5d7ca8390169ba7e713619fe3c9a9cf5","packedSha256":"c44cead5f97e28f708d73c37ad56426f5d7ca8390169ba7e713619fe3c9a9cf5","segments":[[1,1]],"packagePath":"src/Internal/Defaults.luau"},"src/Internal/Derived.luau":{"sourceSha256":"2e9371e466064bb32c03e070f988028a65551b24cf48371fafd3bca4c43a3853","packedSha256":"2e9371e466064bb32c03e070f988028a65551b24cf48371fafd3bca4c43a3853","segments":[[1,1]],"packagePath":"src/Internal/Derived.luau"},"src/Internal/Exchange.luau":{"sourceSha256":"4f0ce1b1ff11304a5712fad7cab166722b1cec74d8ba2c6853503f159c0992b5","packedSha256":"4f0ce1b1ff11304a5712fad7cab166722b1cec74d8ba2c6853503f159c0992b5","segments":[[1,1]],"packagePath":"src/Internal/Exchange.luau"},"src/Internal/ExchangeLeg.luau":{"sourceSha256":"a5513cb477675b89fa3dc08f3965c1b75b540559a40d7274c6ecd293f1dd2da0","packedSha256":"a5513cb477675b89fa3dc08f3965c1b75b540559a40d7274c6ecd293f1dd2da0","segments":[[1,1]],"packagePath":"src/Internal/ExchangeLeg.luau"},"src/Internal/ExchangeVerdict.luau":{"sourceSha256":"c52df0781721a211224fc32dfa7a0c4774144a0305b3b488b41a9ceff9e11e49","packedSha256":"c52df0781721a211224fc32dfa7a0c4774144a0305b3b488b41a9ceff9e11e49","segments":[[1,1]],"packagePath":"src/Internal/ExchangeVerdict.luau"},"src/Internal/Failure.luau":{"sourceSha256":"3fc53bcdb33af62444963e7cac0465e2b63374057e478ebf4f9e7ca68655e457","packedSha256":"3fc53bcdb33af62444963e7cac0465e2b63374057e478ebf4f9e7ca68655e457","segments":[[1,1]],"packagePath":"src/Internal/Failure.luau"},"src/Internal/Health.luau":{"sourceSha256":"c908c7163650d8a408e9a09b9bd4033959a6af130d90f20417fd2757d0613326","packedSha256":"c908c7163650d8a408e9a09b9bd4033959a6af130d90f20417fd2757d0613326","segments":[[1,1]],"packagePath":"src/Internal/Health.luau"},"src/Internal/LeaderboardDiagnostics.luau":{"sourceSha256":"29a41e62d48860532d53b85400f14da6102ff9c7ec976d0c3cd1c42a8b358cff","packedSha256":"29a41e62d48860532d53b85400f14da6102ff9c7ec976d0c3cd1c42a8b358cff","segments":[[1,1]],"packagePath":"src/Internal/LeaderboardDiagnostics.luau"},"src/Internal/Log.luau":{"sourceSha256":"ee0be938e28ab83a8c2700ef493ce3967bf7a9a87b5051b4b62eee0fc4775663","packedSha256":"ee0be938e28ab83a8c2700ef493ce3967bf7a9a87b5051b4b62eee0fc4775663","segments":[[1,1]],"packagePath":"src/Internal/Log.luau"},"src/Internal/Marker.luau":{"sourceSha256":"39d2608afc575a8ed91fa5637f097e5a1f48bd4a232e74113a5fda8eb8001f40","packedSha256":"39d2608afc575a8ed91fa5637f097e5a1f48bd4a232e74113a5fda8eb8001f40","segments":[[1,1]],"packagePath":"src/Internal/Marker.luau"},"src/Internal/Metrics.luau":{"sourceSha256":"9a392963d27a789b13ad079a30b1ffc74efadb58b7199b887063d3c36cf17092","packedSha256":"9a392963d27a789b13ad079a30b1ffc74efadb58b7199b887063d3c36cf17092","segments":[[1,1]],"packagePath":"src/Internal/Metrics.luau"},"src/Internal/Node.luau":{"sourceSha256":"ef28e9cd819578e67201c1ff3df10121c52431d2f25cc31fed8a12d8bd25a335","packedSha256":"d98744b1cbba9c53d7d9335ad0e9ceeb7938c15c6f857c43a334274299f1106c","segments":[[1,1],[2865,3477]],"packagePath":"src/Internal/Node.luau"},"src/Internal/Profile.luau":{"sourceSha256":"c0b84cd983b8f48d43c05600898629b45de2288b8822f6dcf363dc25bdd40f5c","packedSha256":"c0b84cd983b8f48d43c05600898629b45de2288b8822f6dcf363dc25bdd40f5c","segments":[[1,1]],"packagePath":"src/Internal/Profile.luau"},"src/Internal/Rng.luau":{"sourceSha256":"ae10c25f95fcc75755edc3cc39d3713f57b3bf7645805e0f63da896c2f9bfb3a","packedSha256":"ae10c25f95fcc75755edc3cc39d3713f57b3bf7645805e0f63da896c2f9bfb3a","segments":[[1,1]],"packagePath":"src/Internal/Rng.luau"},"src/Internal/Sched.luau":{"sourceSha256":"e4f4bbb4f86a30143c1e23012bf6fd8a0fb5f71b7ae5a1e081a205ea0f5aff20","packedSha256":"e4f4bbb4f86a30143c1e23012bf6fd8a0fb5f71b7ae5a1e081a205ea0f5aff20","segments":[[1,1]],"packagePath":"src/Internal/Sched.luau"},"src/Internal/Signal.luau":{"sourceSha256":"727ffbd16831a9fc998a017c577709d97eb131cc44f2b7835c96f56efc88e09d","packedSha256":"84bd1dcfaf54e5400274254ac774773f58cc65a94ff5c1e172830ab4b26077ac","segments":[[1,1],[65,74],[68,94],[92,137],[99,163],[111,189],[117,208],[188,298],[199,323],[209,345]],"packagePath":"src/Internal/Signal.luau"},"src/Internal/Store/ProfileStore.luau":{"sourceSha256":"8e9562fa7c2d39c693a4f7e9d29ecb198162b0f604bad947be4944a07e30208e","packedSha256":"8e9562fa7c2d39c693a4f7e9d29ecb198162b0f604bad947be4944a07e30208e","segments":[[1,1]],"packagePath":"src/Internal/Store/ProfileStore.luau"},"src/Internal/Store/init.luau":{"sourceSha256":"5a8ede7cccef6dc4a6f1cd63a5a839e20f75f6142746727dd0c73b747dc10aaa","packedSha256":"5a8ede7cccef6dc4a6f1cd63a5a839e20f75f6142746727dd0c73b747dc10aaa","segments":[[1,1]],"packagePath":"src/Internal/Store/init.luau"},"src/Internal/StudioCodec.luau":{"sourceSha256":"223e1864c59872f51692dc489ff2cd99f598c57f99534a7eff5c9f729c1a6d0d","packedSha256":"223e1864c59872f51692dc489ff2cd99f598c57f99534a7eff5c9f729c1a6d0d","segments":[[1,1]],"packagePath":"src/Internal/StudioCodec.luau"},"src/Internal/Template.luau":{"sourceSha256":"5b372db2aac447ec07f0de7dffd60047723140fbfbbb5b785eea005038eeb62c","packedSha256":"5b372db2aac447ec07f0de7dffd60047723140fbfbbb5b785eea005038eeb62c","segments":[[1,1]],"packagePath":"src/Internal/Template.luau"},"src/Internal/Transport.luau":{"sourceSha256":"a76f06205d8452295deaedfc44ee999861b1fbdaa2f89afb30c89a1a69a9f6cf","packedSha256":"a76f06205d8452295deaedfc44ee999861b1fbdaa2f89afb30c89a1a69a9f6cf","segments":[[1,1]],"packagePath":"src/Internal/Transport.luau"},"src/Internal/Util.luau":{"sourceSha256":"7ca3a553353e2ab4ffd41b6f0855376571590243614fe2739f1ae302ee96a80c","packedSha256":"7ca3a553353e2ab4ffd41b6f0855376571590243614fe2739f1ae302ee96a80c","segments":[[1,1]],"packagePath":"src/Internal/Util.luau"},"src/Internal/Version.luau":{"sourceSha256":"c473bdcb0f7a0704eac704014dd62ad7439d12e2b6886c1137312bf858f4ef5e","packedSha256":"c473bdcb0f7a0704eac704014dd62ad7439d12e2b6886c1137312bf858f4ef5e","segments":[[1,1]],"packagePath":"src/Internal/Version.luau"},"src/Internal/Wire.luau":{"sourceSha256":"79c28842e0a87136dabc895ec0e6582ccd2fb61d58b4c18796f10501b16802b1","packedSha256":"79c28842e0a87136dabc895ec0e6582ccd2fb61d58b4c18796f10501b16802b1","segments":[[1,1]],"packagePath":"src/Internal/Wire.luau"},"src/Server/Analytics.luau":{"sourceSha256":"2f7aa3a7074d992df397952ae96e12a146daed0c2babeb12dd41640a699bd252","packedSha256":"2f7aa3a7074d992df397952ae96e12a146daed0c2babeb12dd41640a699bd252","segments":[[1,1]],"packagePath":"src/Server/Analytics.luau"},"src/Server/Commands.luau":{"sourceSha256":"d73898103e7107b5b881d8ccd4b979e6699fa95753e4cc07de8a5c1fba3fa446","packedSha256":"d73898103e7107b5b881d8ccd4b979e6699fa95753e4cc07de8a5c1fba3fa446","segments":[[1,1]],"packagePath":"src/Server/Commands.luau"},"src/Server/DebugHook.luau":{"sourceSha256":"4bb36e7c697e340e688b44ae9c63a21fc4c2b88afecf327ac1eb869da7dc9aff","packedSha256":"4bb36e7c697e340e688b44ae9c63a21fc4c2b88afecf327ac1eb869da7dc9aff","segments":[[1,1]],"packagePath":"src/Server/DebugHook.luau"},"src/Server/Exchanges.luau":{"sourceSha256":"ea97536a56ad89aac9cee792f5a3b792f1f7b6d958577b9de1f120eb50fe7a38","packedSha256":"ea97536a56ad89aac9cee792f5a3b792f1f7b6d958577b9de1f120eb50fe7a38","segments":[[1,1]],"packagePath":"src/Server/Exchanges.luau"},"src/Server/Leaderboards.luau":{"sourceSha256":"e925f859f8a248d2fd343c2f40eb402cb170b97cc4ef54cc8a020701af0fb8ce","packedSha256":"e925f859f8a248d2fd343c2f40eb402cb170b97cc4ef54cc8a020701af0fb8ce","segments":[[1,1]],"packagePath":"src/Server/Leaderboards.luau"},"src/Server/Monetization.luau":{"sourceSha256":"ab024ca3834c050aac2d9c7ae7a5730cf1dea803184930cd4ba368f2ad13113c","packedSha256":"ab024ca3834c050aac2d9c7ae7a5730cf1dea803184930cd4ba368f2ad13113c","segments":[[1,1]],"packagePath":"src/Server/Monetization.luau"},"src/Server/Persistence.luau":{"sourceSha256":"62333045eb93be30c718405c4306fd5601f3820af4e9c9447ce228db2938f76f","packedSha256":"62333045eb93be30c718405c4306fd5601f3820af4e9c9447ce228db2938f76f","segments":[[1,1]],"packagePath":"src/Server/Persistence.luau"},"src/Server/Replication.luau":{"sourceSha256":"fd6e9b12653f41dd5c98da9d07556fae6d222ed872a767114c465b6ee7967cdc","packedSha256":"fd6e9b12653f41dd5c98da9d07556fae6d222ed872a767114c465b6ee7967cdc","segments":[[1,1]],"packagePath":"src/Server/Replication.luau"},"src/Server/ServerStore.luau":{"sourceSha256":"e7bbcb087d9b1606ab15c0e203d736cac690fe3c40a8a12f92eb2543ec42592b","packedSha256":"e7bbcb087d9b1606ab15c0e203d736cac690fe3c40a8a12f92eb2543ec42592b","segments":[[1,1]],"packagePath":"src/Server/ServerStore.luau"},"src/Server/Timed.luau":{"sourceSha256":"c568536c2a00c70e6f7fde40a1470b2b5c0b6c30dbea03389b87b196b75349fb","packedSha256":"c568536c2a00c70e6f7fde40a1470b2b5c0b6c30dbea03389b87b196b75349fb","segments":[[1,1]],"packagePath":"src/Server/Timed.luau"},"src/Server/init.luau":{"sourceSha256":"2d72000341861fbde9b983e620808d67b26bc83188ccc4fcb376f31f3d19a9be","packedSha256":"c24f7b11addb67335f042677ad16279059ec655953abc62c7496a87856203cd4","segments":[[1,1],[141,158],[177,235],[181,252],[185,265],[190,297],[195,328],[201,371],[206,387],[210,408],[214,480],[219,497],[223,513],[227,542],[232,572],[236,586],[241,631],[246,758],[269,796],[273,809],[277,824],[281,838],[285,853],[290,911],[294,933],[298,951],[302,963],[306,982],[311,1012],[315,1030],[319,1052],[323,1069],[327,1081],[331,1093],[335,1132],[339,1144],[343,1162],[355,1201],[367,1222],[373,1236],[379,1251],[381,1263],[383,1275],[385,1302],[387,1351],[393,1366],[395,1391],[398,1428],[463,1504],[526,1575],[539,1606],[574,1653]],"packagePath":"src/Server/init.luau"},"src/Types.luau":{"sourceSha256":"3fa3458fc319ac0aa296f7bbb0c3068125437c80e09a0b91b272e6efb57a5b78","packedSha256":"3fa3458fc319ac0aa296f7bbb0c3068125437c80e09a0b91b272e6efb57a5b78","segments":[[1,1]],"packagePath":"src/Types.luau"},"src/init.luau":{"sourceSha256":"49781ce9f189b032f91dde946401056e15b2cf5c21d5a998117e73bbfe12df4f","packedSha256":"8fc79046c70a17f906c2b12181b0ebfffce23747a073d6a6dfe1591089b586bd","segments":[[1,1],[1845,1873],[1854,2496],[2063,2730],[2066,2739],[2068,2763],[2075,2784],[2082,2806],[2089,2825],[2096,2857],[2103,2892],[2110,2915],[2117,2933],[2124,2965],[2131,2983],[2138,3015],[2147,3049],[2154,3082],[2161,3115],[2181,3161],[2205,3211],[2230,3261],[2255,3302],[2283,3355],[2381,3476],[2384,3522],[2398,3552],[2405,3582],[2452,3645],[2467,3685],[2470,3700],[2483,3728],[2502,3764],[2511,3779],[2520,3794],[2529,3809],[2544,3830],[2551,3843],[2558,3856],[2565,3869],[2576,3886],[2583,3900],[2586,3913],[2593,3929],[2600,3946],[2607,3962],[2610,3974],[2613,3995],[2620,4017],[2627,4038],[2634,4055],[2641,4089],[2648,4121],[2655,4145]],"packagePath":"src/init.luau"}}}
1
+ {"version":"2.7.0","format":1,"description":"Segments are [packedLine, sourceLine]. Use the last segment at or before the packed line, then add its line offset.","files":{"src/Client/DebugHook.luau":{"sourceSha256":"c382ebae369a4b32ebd93adb914e0414e481d170bf117caf24ba322e272b58d4","packedSha256":"c382ebae369a4b32ebd93adb914e0414e481d170bf117caf24ba322e272b58d4","segments":[[1,1]],"packagePath":"src/Client/DebugHook.luau"},"src/Client/init.luau":{"sourceSha256":"dc03fe66350aa88b1b05b59be09cea7fb8bdb02300095e95fc45ea879d98528b","packedSha256":"6491797908ff4fff8f0f3ada37452658cecfc8ff6ed12bebcf590665268ea2ee","segments":[[1,1],[543,556],[545,566],[550,588],[660,718],[665,744],[679,768],[696,793],[702,808],[705,819],[710,833],[713,849],[724,869],[726,883],[751,918],[765,946],[854,1045],[1190,1398],[1201,1418],[1208,1435],[1242,1479],[1249,1497],[1288,1546],[1312,1579],[1320,1600],[1326,1637],[1353,1675],[1382,1714],[1392,1732],[1402,1756],[1497,1865],[1540,1917],[1558,1943],[1560,1956],[1568,1986],[1573,2003]],"packagePath":"src/Client/init.luau"},"src/Internal/Addons.luau":{"sourceSha256":"35b63237bb0f1b1a6779b70ff67a3618afa2afe9eca058ddf7a3510044feab20","packedSha256":"35b63237bb0f1b1a6779b70ff67a3618afa2afe9eca058ddf7a3510044feab20","segments":[[1,1]],"packagePath":"src/Internal/Addons.luau"},"src/Internal/Big.luau":{"sourceSha256":"a5db31c60a665fa0967d105ce5296ba2fbfd405ffc89839b1b47c30985d05fa4","packedSha256":"b1bfe0e6a85a1297535b9c74d8016209441fe360f11cc3b58cc36696375c6f52","segments":[[1,1],[442,451],[447,464],[452,478],[457,492],[462,504],[469,521],[474,535],[566,674],[575,702],[580,727],[585,753],[590,782]],"packagePath":"src/Internal/Big.luau"},"src/Internal/Budget.luau":{"sourceSha256":"8a0f85b03ba48e4915536039d33f29739f5e3fc47a8d9af8a7d51fc8f865aab3","packedSha256":"8a0f85b03ba48e4915536039d33f29739f5e3fc47a8d9af8a7d51fc8f865aab3","segments":[[1,1]],"packagePath":"src/Internal/Budget.luau"},"src/Internal/Clock.luau":{"sourceSha256":"c0f81c8042945b97b28aa67146bb75276bf781bbf7ee5f1e98c99f20de912f17","packedSha256":"c0f81c8042945b97b28aa67146bb75276bf781bbf7ee5f1e98c99f20de912f17","segments":[[1,1]],"packagePath":"src/Internal/Clock.luau"},"src/Internal/Config.luau":{"sourceSha256":"1e76048f1f1ab3cb477ddb194ec5689f6d0b8ac6acdb48ea992d5e810944d373","packedSha256":"1e76048f1f1ab3cb477ddb194ec5689f6d0b8ac6acdb48ea992d5e810944d373","segments":[[1,1]],"packagePath":"src/Internal/Config.luau"},"src/Internal/Conform.luau":{"sourceSha256":"9ca454cda7d264b35090a91b74bbedc042a0abea334fa87f36a41c34476021ee","packedSha256":"9ca454cda7d264b35090a91b74bbedc042a0abea334fa87f36a41c34476021ee","segments":[[1,1]],"packagePath":"src/Internal/Conform.luau"},"src/Internal/Datatypes.luau":{"sourceSha256":"ffc6ef66d28c04fa4bd132ff330a83e8e10f343cf9ce6c88fdb1f095d0fec938","packedSha256":"ffc6ef66d28c04fa4bd132ff330a83e8e10f343cf9ce6c88fdb1f095d0fec938","segments":[[1,1]],"packagePath":"src/Internal/Datatypes.luau"},"src/Internal/Defaults.luau":{"sourceSha256":"c44cead5f97e28f708d73c37ad56426f5d7ca8390169ba7e713619fe3c9a9cf5","packedSha256":"c44cead5f97e28f708d73c37ad56426f5d7ca8390169ba7e713619fe3c9a9cf5","segments":[[1,1]],"packagePath":"src/Internal/Defaults.luau"},"src/Internal/Derived.luau":{"sourceSha256":"2e9371e466064bb32c03e070f988028a65551b24cf48371fafd3bca4c43a3853","packedSha256":"2e9371e466064bb32c03e070f988028a65551b24cf48371fafd3bca4c43a3853","segments":[[1,1]],"packagePath":"src/Internal/Derived.luau"},"src/Internal/Exchange.luau":{"sourceSha256":"4f0ce1b1ff11304a5712fad7cab166722b1cec74d8ba2c6853503f159c0992b5","packedSha256":"4f0ce1b1ff11304a5712fad7cab166722b1cec74d8ba2c6853503f159c0992b5","segments":[[1,1]],"packagePath":"src/Internal/Exchange.luau"},"src/Internal/ExchangeLeg.luau":{"sourceSha256":"a5513cb477675b89fa3dc08f3965c1b75b540559a40d7274c6ecd293f1dd2da0","packedSha256":"a5513cb477675b89fa3dc08f3965c1b75b540559a40d7274c6ecd293f1dd2da0","segments":[[1,1]],"packagePath":"src/Internal/ExchangeLeg.luau"},"src/Internal/ExchangeVerdict.luau":{"sourceSha256":"c52df0781721a211224fc32dfa7a0c4774144a0305b3b488b41a9ceff9e11e49","packedSha256":"c52df0781721a211224fc32dfa7a0c4774144a0305b3b488b41a9ceff9e11e49","segments":[[1,1]],"packagePath":"src/Internal/ExchangeVerdict.luau"},"src/Internal/Failure.luau":{"sourceSha256":"3fc53bcdb33af62444963e7cac0465e2b63374057e478ebf4f9e7ca68655e457","packedSha256":"3fc53bcdb33af62444963e7cac0465e2b63374057e478ebf4f9e7ca68655e457","segments":[[1,1]],"packagePath":"src/Internal/Failure.luau"},"src/Internal/Health.luau":{"sourceSha256":"c908c7163650d8a408e9a09b9bd4033959a6af130d90f20417fd2757d0613326","packedSha256":"c908c7163650d8a408e9a09b9bd4033959a6af130d90f20417fd2757d0613326","segments":[[1,1]],"packagePath":"src/Internal/Health.luau"},"src/Internal/LeaderboardDiagnostics.luau":{"sourceSha256":"29a41e62d48860532d53b85400f14da6102ff9c7ec976d0c3cd1c42a8b358cff","packedSha256":"29a41e62d48860532d53b85400f14da6102ff9c7ec976d0c3cd1c42a8b358cff","segments":[[1,1]],"packagePath":"src/Internal/LeaderboardDiagnostics.luau"},"src/Internal/Log.luau":{"sourceSha256":"ee0be938e28ab83a8c2700ef493ce3967bf7a9a87b5051b4b62eee0fc4775663","packedSha256":"ee0be938e28ab83a8c2700ef493ce3967bf7a9a87b5051b4b62eee0fc4775663","segments":[[1,1]],"packagePath":"src/Internal/Log.luau"},"src/Internal/Marker.luau":{"sourceSha256":"39d2608afc575a8ed91fa5637f097e5a1f48bd4a232e74113a5fda8eb8001f40","packedSha256":"39d2608afc575a8ed91fa5637f097e5a1f48bd4a232e74113a5fda8eb8001f40","segments":[[1,1]],"packagePath":"src/Internal/Marker.luau"},"src/Internal/Metrics.luau":{"sourceSha256":"9a392963d27a789b13ad079a30b1ffc74efadb58b7199b887063d3c36cf17092","packedSha256":"9a392963d27a789b13ad079a30b1ffc74efadb58b7199b887063d3c36cf17092","segments":[[1,1]],"packagePath":"src/Internal/Metrics.luau"},"src/Internal/Node.luau":{"sourceSha256":"ef28e9cd819578e67201c1ff3df10121c52431d2f25cc31fed8a12d8bd25a335","packedSha256":"d98744b1cbba9c53d7d9335ad0e9ceeb7938c15c6f857c43a334274299f1106c","segments":[[1,1],[2865,3477]],"packagePath":"src/Internal/Node.luau"},"src/Internal/Profile.luau":{"sourceSha256":"c0b84cd983b8f48d43c05600898629b45de2288b8822f6dcf363dc25bdd40f5c","packedSha256":"c0b84cd983b8f48d43c05600898629b45de2288b8822f6dcf363dc25bdd40f5c","segments":[[1,1]],"packagePath":"src/Internal/Profile.luau"},"src/Internal/Rng.luau":{"sourceSha256":"ae10c25f95fcc75755edc3cc39d3713f57b3bf7645805e0f63da896c2f9bfb3a","packedSha256":"ae10c25f95fcc75755edc3cc39d3713f57b3bf7645805e0f63da896c2f9bfb3a","segments":[[1,1]],"packagePath":"src/Internal/Rng.luau"},"src/Internal/Sched.luau":{"sourceSha256":"e4f4bbb4f86a30143c1e23012bf6fd8a0fb5f71b7ae5a1e081a205ea0f5aff20","packedSha256":"e4f4bbb4f86a30143c1e23012bf6fd8a0fb5f71b7ae5a1e081a205ea0f5aff20","segments":[[1,1]],"packagePath":"src/Internal/Sched.luau"},"src/Internal/Signal.luau":{"sourceSha256":"727ffbd16831a9fc998a017c577709d97eb131cc44f2b7835c96f56efc88e09d","packedSha256":"84bd1dcfaf54e5400274254ac774773f58cc65a94ff5c1e172830ab4b26077ac","segments":[[1,1],[65,74],[68,94],[92,137],[99,163],[111,189],[117,208],[188,298],[199,323],[209,345]],"packagePath":"src/Internal/Signal.luau"},"src/Internal/Store/ProfileStore.luau":{"sourceSha256":"8e9562fa7c2d39c693a4f7e9d29ecb198162b0f604bad947be4944a07e30208e","packedSha256":"8e9562fa7c2d39c693a4f7e9d29ecb198162b0f604bad947be4944a07e30208e","segments":[[1,1]],"packagePath":"src/Internal/Store/ProfileStore.luau"},"src/Internal/Store/init.luau":{"sourceSha256":"5a8ede7cccef6dc4a6f1cd63a5a839e20f75f6142746727dd0c73b747dc10aaa","packedSha256":"5a8ede7cccef6dc4a6f1cd63a5a839e20f75f6142746727dd0c73b747dc10aaa","segments":[[1,1]],"packagePath":"src/Internal/Store/init.luau"},"src/Internal/StudioCodec.luau":{"sourceSha256":"223e1864c59872f51692dc489ff2cd99f598c57f99534a7eff5c9f729c1a6d0d","packedSha256":"223e1864c59872f51692dc489ff2cd99f598c57f99534a7eff5c9f729c1a6d0d","segments":[[1,1]],"packagePath":"src/Internal/StudioCodec.luau"},"src/Internal/Template.luau":{"sourceSha256":"5b372db2aac447ec07f0de7dffd60047723140fbfbbb5b785eea005038eeb62c","packedSha256":"5b372db2aac447ec07f0de7dffd60047723140fbfbbb5b785eea005038eeb62c","segments":[[1,1]],"packagePath":"src/Internal/Template.luau"},"src/Internal/Transport.luau":{"sourceSha256":"a76f06205d8452295deaedfc44ee999861b1fbdaa2f89afb30c89a1a69a9f6cf","packedSha256":"a76f06205d8452295deaedfc44ee999861b1fbdaa2f89afb30c89a1a69a9f6cf","segments":[[1,1]],"packagePath":"src/Internal/Transport.luau"},"src/Internal/Util.luau":{"sourceSha256":"7ca3a553353e2ab4ffd41b6f0855376571590243614fe2739f1ae302ee96a80c","packedSha256":"7ca3a553353e2ab4ffd41b6f0855376571590243614fe2739f1ae302ee96a80c","segments":[[1,1]],"packagePath":"src/Internal/Util.luau"},"src/Internal/Version.luau":{"sourceSha256":"246bb560389b962b5c7b920d948c325f52fd6530ff252cd680e61a30871fd658","packedSha256":"246bb560389b962b5c7b920d948c325f52fd6530ff252cd680e61a30871fd658","segments":[[1,1]],"packagePath":"src/Internal/Version.luau"},"src/Internal/Wire.luau":{"sourceSha256":"79c28842e0a87136dabc895ec0e6582ccd2fb61d58b4c18796f10501b16802b1","packedSha256":"79c28842e0a87136dabc895ec0e6582ccd2fb61d58b4c18796f10501b16802b1","segments":[[1,1]],"packagePath":"src/Internal/Wire.luau"},"src/Server/Analytics.luau":{"sourceSha256":"2f7aa3a7074d992df397952ae96e12a146daed0c2babeb12dd41640a699bd252","packedSha256":"2f7aa3a7074d992df397952ae96e12a146daed0c2babeb12dd41640a699bd252","segments":[[1,1]],"packagePath":"src/Server/Analytics.luau"},"src/Server/Commands.luau":{"sourceSha256":"19b6076cc912fbcb8a1b01128f655a1be155a84d79d5f62b16af9f68b5104368","packedSha256":"19b6076cc912fbcb8a1b01128f655a1be155a84d79d5f62b16af9f68b5104368","segments":[[1,1]],"packagePath":"src/Server/Commands.luau"},"src/Server/DebugHook.luau":{"sourceSha256":"4bb36e7c697e340e688b44ae9c63a21fc4c2b88afecf327ac1eb869da7dc9aff","packedSha256":"4bb36e7c697e340e688b44ae9c63a21fc4c2b88afecf327ac1eb869da7dc9aff","segments":[[1,1]],"packagePath":"src/Server/DebugHook.luau"},"src/Server/Exchanges.luau":{"sourceSha256":"ea97536a56ad89aac9cee792f5a3b792f1f7b6d958577b9de1f120eb50fe7a38","packedSha256":"ea97536a56ad89aac9cee792f5a3b792f1f7b6d958577b9de1f120eb50fe7a38","segments":[[1,1]],"packagePath":"src/Server/Exchanges.luau"},"src/Server/Leaderboards.luau":{"sourceSha256":"e925f859f8a248d2fd343c2f40eb402cb170b97cc4ef54cc8a020701af0fb8ce","packedSha256":"e925f859f8a248d2fd343c2f40eb402cb170b97cc4ef54cc8a020701af0fb8ce","segments":[[1,1]],"packagePath":"src/Server/Leaderboards.luau"},"src/Server/Monetization.luau":{"sourceSha256":"9eb246bfe3ffb3f8df0d49f6265c63e19ddb312cf6ed84febaec7b2e4020e0dd","packedSha256":"9eb246bfe3ffb3f8df0d49f6265c63e19ddb312cf6ed84febaec7b2e4020e0dd","segments":[[1,1]],"packagePath":"src/Server/Monetization.luau"},"src/Server/Persistence.luau":{"sourceSha256":"ad7ca94582f15a12bccba5e9f13224061d2e68c0e5c712023dee191ddb8799f3","packedSha256":"ad7ca94582f15a12bccba5e9f13224061d2e68c0e5c712023dee191ddb8799f3","segments":[[1,1]],"packagePath":"src/Server/Persistence.luau"},"src/Server/Replication.luau":{"sourceSha256":"2e8b263d861dbe10d0db31514fa3ef1498b53f6e966f82aecb4c4ca68f4327e6","packedSha256":"2e8b263d861dbe10d0db31514fa3ef1498b53f6e966f82aecb4c4ca68f4327e6","segments":[[1,1]],"packagePath":"src/Server/Replication.luau"},"src/Server/ServerStore.luau":{"sourceSha256":"e7bbcb087d9b1606ab15c0e203d736cac690fe3c40a8a12f92eb2543ec42592b","packedSha256":"e7bbcb087d9b1606ab15c0e203d736cac690fe3c40a8a12f92eb2543ec42592b","segments":[[1,1]],"packagePath":"src/Server/ServerStore.luau"},"src/Server/Timed.luau":{"sourceSha256":"945426daaeda204f6e17a7b31e38c6b309c45c06705a2c51a7020222c8b91e2b","packedSha256":"945426daaeda204f6e17a7b31e38c6b309c45c06705a2c51a7020222c8b91e2b","segments":[[1,1]],"packagePath":"src/Server/Timed.luau"},"src/Server/init.luau":{"sourceSha256":"0eb3acf0fec625003ae6e3bb92186f3dca0baa3c2d73825ce8978ef8c83fe456","packedSha256":"c24f7b11addb67335f042677ad16279059ec655953abc62c7496a87856203cd4","segments":[[1,1],[141,158],[177,235],[181,252],[185,265],[190,297],[195,328],[201,371],[206,387],[210,408],[214,480],[219,497],[223,513],[227,542],[232,572],[236,586],[241,630],[246,757],[269,795],[273,808],[277,823],[281,837],[285,852],[290,910],[294,932],[298,950],[302,962],[306,981],[311,1011],[315,1029],[319,1051],[323,1068],[327,1080],[331,1092],[335,1131],[339,1143],[343,1161],[355,1200],[367,1221],[373,1235],[379,1250],[381,1262],[383,1274],[385,1301],[387,1350],[393,1365],[395,1390],[398,1427],[463,1503],[526,1574],[539,1605],[574,1652]],"packagePath":"src/Server/init.luau"},"src/Types.luau":{"sourceSha256":"a377915fc4449d370f7fff5e53f47555c2cfc90a20febe1271acd269890d195c","packedSha256":"a377915fc4449d370f7fff5e53f47555c2cfc90a20febe1271acd269890d195c","segments":[[1,1]],"packagePath":"src/Types.luau"},"src/init.luau":{"sourceSha256":"be9530a82209cc3ce4a0d50fbd03ae371553acbe5598f7e8eee87cab92153fec","packedSha256":"00aae502913049700a6858dfed3a09a6717f5eeed06768b5c3fe48feba35c108","segments":[[1,1],[1845,1873],[1854,2496],[2063,2730],[2066,2739],[2068,2763],[2075,2784],[2082,2806],[2089,2825],[2096,2857],[2103,2892],[2110,2915],[2117,2933],[2124,2965],[2131,2983],[2138,3015],[2147,3049],[2154,3082],[2161,3115],[2181,3161],[2205,3211],[2230,3261],[2255,3302],[2283,3355],[2381,3476],[2384,3522],[2398,3552],[2405,3582],[2452,3645],[2467,3685],[2470,3700],[2483,3728],[2502,3764],[2511,3779],[2520,3794],[2529,3809],[2544,3830],[2551,3843],[2558,3856],[2565,3869],[2576,3886],[2583,3900],[2586,3913],[2593,3929],[2600,3946],[2607,3962],[2610,3974],[2613,3995],[2620,4017],[2627,4038],[2634,4055],[2641,4089],[2648,4121],[2655,4145]],"packagePath":"src/init.luau"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/scribe",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "description": "Persistent, schema-typed, automatically replicated Roblox data.",
5
5
  "main": "src/init.luau",
6
6
  "types": "types/index.d.ts",
@@ -854,9 +854,6 @@ function Client.new(options: any, compiled: Template.Compiled): any
854
854
  -- Reports current ownership and later changes; returns a disconnect.
855
855
  function Data.ObserveOwned(key: string, callback: (owned: boolean) -> ()): () -> ()
856
856
  assertOwnsKey(key, "ObserveOwned")
857
- if not editMode then
858
- waitForLoaded()
859
- end
860
857
  local last: boolean? = nil
861
858
  local function push()
862
859
  local owned = ownsFromMirror(key)
@@ -867,10 +864,18 @@ function Client.new(options: any, compiled: Template.Compiled): any
867
864
  end
868
865
  local disconnectPerk = tree.Reserved.Perks.Changed(push)
869
866
  local disconnectCache = tree.ReservedSession.OwnsCache.Changed(push)
870
- push()
867
+ local untilLoaded: any = nil
868
+ if loaded then
869
+ push()
870
+ else
871
+ untilLoaded = loadedSignal:Once(push)
872
+ end
871
873
  return function()
872
874
  disconnectPerk()
873
875
  disconnectCache()
876
+ if untilLoaded then
877
+ untilLoaded:Disconnect()
878
+ end
874
879
  end
875
880
  end
876
881
 
@@ -1450,13 +1455,41 @@ function Client.new(options: any, compiled: Template.Compiled): any
1450
1455
  end
1451
1456
  end
1452
1457
 
1453
- local function deepMerge(base: any, over: any): any
1458
+ -- Infer lists in untyped mock data from the key count and array length.
1459
+ local function isSequence(t: { [any]: any }): boolean
1460
+ local count = 0
1461
+ for _ in t do
1462
+ count += 1
1463
+ end
1464
+ return count == #t
1465
+ end
1466
+
1467
+ local function mockMerge(base: any, over: any, schema: Template.SchemaNode?): any
1454
1468
  if type(base) ~= "table" or type(over) ~= "table" then
1455
1469
  return Util.deepClone(over)
1456
1470
  end
1471
+ if schema ~= nil and (schema.Kind == "leaf" or schema.ValueType == "flags" or schema.Container == "Array") then
1472
+ return Util.deepClone(over)
1473
+ end
1474
+ local untyped = schema == nil
1475
+ or schema.Kind == "any"
1476
+ or (schema.Container == nil and (schema.Children == nil or next(schema.Children) == nil))
1477
+ if untyped and isSequence(over) and (#over > 0 or isSequence(base)) then
1478
+ return Util.deepClone(over)
1479
+ end
1457
1480
  local out = Util.deepClone(base)
1458
1481
  for key, value in over do
1459
- out[key] = deepMerge(out[key], value)
1482
+ -- ChildSchema can cache an undeclared key on the shared schema.
1483
+ local child: Template.SchemaNode? = nil
1484
+ if schema ~= nil then
1485
+ if type(key) == "string" and schema.Children ~= nil then
1486
+ child = schema.Children[key]
1487
+ end
1488
+ if child == nil and schema.Container == "Dict" then
1489
+ child = schema.AnyChild
1490
+ end
1491
+ end
1492
+ out[key] = mockMerge(out[key], value, child)
1460
1493
  end
1461
1494
  return out
1462
1495
  end
@@ -1470,7 +1503,8 @@ function Client.new(options: any, compiled: Template.Compiled): any
1470
1503
  if values then
1471
1504
  for key, value in values do
1472
1505
  local current = mirror[key]
1473
- tree.Accessor.Child(key).Set(deepMerge(current, value))
1506
+ local rootSchema = if compiled.Root.Children then compiled.Root.Children[key] else nil
1507
+ tree.Accessor.Child(key).Set(mockMerge(current, value, rootSchema))
1474
1508
  end
1475
1509
  end
1476
1510
  if scribeState then
@@ -366,15 +366,23 @@ function Big.toShort(a: Big, decimals: number?): string
366
366
  if string.match(text, "[1-9]") == nil then
367
367
  return Big.toString(a)
368
368
  end
369
- return text
369
+ if math.abs(tonumber(text) :: number) < 1000 then
370
+ return text
371
+ end
370
372
  end
371
373
  local tier = math.floor(a.E / 3)
374
+ local scaled = a.M * 10 ^ (a.E - tier * 3)
375
+ local text = string.format(`%.{places}f`, scaled)
376
+ -- Carry a rounded 1000 into the next tier.
377
+ if math.abs(tonumber(text) :: number) >= 1000 then
378
+ tier += 1
379
+ text = string.format(`%.{places}f`, scaled / 1000)
380
+ end
372
381
  local suffix = SUFFIXES[tier + 1]
373
382
  if suffix == nil then
374
383
  return Big.toString(a)
375
384
  end
376
- local scaled = a.M * 10 ^ (a.E - tier * 3)
377
- return string.format(`%.{places}f{suffix}`, scaled)
385
+ return text .. suffix
378
386
  end
379
387
 
380
388
  -- Coerce an operand of an arithmetic metamethod, erroring at level 3 so the blame
@@ -1,4 +1,4 @@
1
1
  --!strict
2
2
  -- Single source of truth for the release version. Keep wally.toml in sync.
3
3
 
4
- return "2.6.1"
4
+ return "2.7.0"
@@ -298,6 +298,8 @@ function Commands.new(ctx: any)
298
298
  record.Done = true
299
299
  record.Ok = ok
300
300
  record.Reply = bytes
301
+ -- Start the replay window when the handler finishes.
302
+ record.At = Clock.Monotonic()
301
303
  if not ok then
302
304
  -- Dropped before the parked duplicates are answered. A handler that threw did
303
305
  -- not happen, so the key stays retryable, and a synchronous transport can
@@ -340,6 +342,16 @@ function Commands.new(ctx: any)
340
342
  Log.Warn("Commands", code, message, context)
341
343
  end
342
344
 
345
+ -- A sparse table's length can equal its key count. Check each index.
346
+ local function isSequence(value: { [any]: any }, count: number): boolean
347
+ for index = 1, count do
348
+ if value[index] == nil then
349
+ return false
350
+ end
351
+ end
352
+ return true
353
+ end
354
+
343
355
  -- Does one argument match its spec? A spec is one of three things:
344
356
  --
345
357
  -- "string", "number?", "any" a type string
@@ -384,12 +396,14 @@ function Commands.new(ctx: any)
384
396
  local elementSpec = expected[1]
385
397
  if elementSpec ~= nil then
386
398
  -- Array form: every element matches and no extra keys hide alongside them.
399
+ local count = 0
387
400
  for key, item in value do
388
401
  if type(key) ~= "number" or not specMatches(elementSpec, item, depth + 1) then
389
402
  return false
390
403
  end
404
+ count += 1
391
405
  end
392
- return true
406
+ return isSequence(value, count)
393
407
  end
394
408
  for key, fieldSpec in expected do
395
409
  if not specMatches(fieldSpec, value[key], depth + 1) then
@@ -450,7 +464,7 @@ function Commands.new(ctx: any)
450
464
  end
451
465
  count += 1
452
466
  end
453
- return count == #value
467
+ return isSequence(value, count)
454
468
  end
455
469
  if kind == "ArrayOf" or kind == "SetOf" then
456
470
  if type(value) ~= "table" then
@@ -463,7 +477,7 @@ function Commands.new(ctx: any)
463
477
  end
464
478
  count += 1
465
479
  end
466
- if count ~= #value then
480
+ if not isSequence(value, count) then
467
481
  return false -- holes or string keys hiding in an array
468
482
  end
469
483
  return meta.MaxItems == nil or count <= meta.MaxItems
@@ -150,7 +150,7 @@ function Monetization.new(ctx: any)
150
150
  Name: string,
151
151
  Id: number,
152
152
  Category: string?,
153
- Grant: ((data: any) -> ())?,
153
+ Grant: ((data: any, player: Player) -> ())?,
154
154
  Grants: string?,
155
155
  PaidRandom: boolean,
156
156
  Retired: boolean,
@@ -1206,7 +1206,8 @@ function Monetization.new(ctx: any)
1206
1206
  -- rather than silently rolled back.
1207
1207
  local function apply()
1208
1208
  if product.Grant then
1209
- (product.Grant :: (any) -> ())(entry.Tree.Accessor)
1209
+ -- A gift uses the recipient's entry.
1210
+ (product.Grant :: (any, Player) -> ())(entry.Tree.Accessor, entry.Player)
1210
1211
  end
1211
1212
  if product.Grants then
1212
1213
  checkPerkName(product.Grants)
@@ -1864,7 +1865,7 @@ function Monetization.new(ctx: any)
1864
1865
 
1865
1866
  if product.Grants and not product.Grant then
1866
1867
  -- A giftable perk product bought without intent: grant to the buyer.
1867
- Log.Warn("Gifting", "GIFT_NO_INTENT", "perk product purchased with no gift intent; granting to buyer", {
1868
+ Log.Info("Gifting", "GIFT_NO_INTENT", "perk product purchased with no gift intent; granting to buyer", {
1868
1869
  Player = entry.Player,
1869
1870
  Product = product.Name,
1870
1871
  })
@@ -3081,7 +3082,7 @@ function Monetization.new(ctx: any)
3081
3082
  costAccessor.Set(balance - amount)
3082
3083
  end
3083
3084
  if spec.Grant then
3084
- (spec.Grant :: (any) -> ())(entry.Tree.Accessor)
3085
+ (spec.Grant :: (any, Player) -> ())(entry.Tree.Accessor, entry.Player)
3085
3086
  end
3086
3087
  checkCategory(spec.Category)
3087
3088
  -- Claimed INSIDE the transaction, so a Grant that throws rolls the claim back with
@@ -81,7 +81,9 @@ export type Entry = {
81
81
  SizeWarned: boolean,
82
82
  TornDown: boolean,
83
83
  -- Replication state (owned by Replication.luau)
84
+ ReadyAt: number?, -- monotonic time the profile became Ready
84
85
  HelloReceived: boolean,
86
+ HelloRefused: boolean?, -- first mismatch already logged
85
87
  -- Two flags, deliberately: QueueOpen means a snapshot has been taken, so a write
86
88
  -- belongs in the queue; HandshakeReady means the snapshot is on the wire, so this
87
89
  -- client may be sent frames. One flag left a gap between those two moments in
@@ -104,6 +106,7 @@ export type Entry = {
104
106
  Queue: { any },
105
107
  QueueIndex: { [string]: number },
106
108
  SharedQueue: { any },
109
+ SharedIndex: { [string]: number },
107
110
  MalformedCount: number,
108
111
  MalformedBlocked: boolean?, -- crossed the malformed-frame limit; inbound frames ignored
109
112
  LastMalformedLog: number?, -- os.clock of the last emitted malformed-frame log/anomaly
@@ -354,6 +357,12 @@ function Persistence.new(ctx: any)
354
357
  -- per-player session store, or the per-player snapshot.
355
358
  local playerCompiled = compiled.Views.Player
356
359
  local persistentDefaults = Template.BuildDefaults(playerCompiled, "Persistent")
360
+ local sessionRootNames: { [string]: boolean } = {}
361
+ for name, node in (playerCompiled.Root.Children or {}) :: { [string]: any } do
362
+ if node.Persist == false then
363
+ sessionRootNames[name] = true
364
+ end
365
+ end
357
366
  local baseStore = ProfileStore.New(storeIndex, persistentDefaults)
358
367
  -- Persistence mode: which store to read, whether to hold a session, whether anything
359
368
  -- saves.
@@ -2107,15 +2116,19 @@ function Persistence.new(ctx: any)
2107
2116
  local data = profile.Data
2108
2117
  local view = table.clone(data)
2109
2118
  view[Template.RESERVED_ROOT] = nil
2119
+ -- Hide legacy Session keys from the hook and preserve them in the profile.
2120
+ for name in sessionRootNames do
2121
+ view[name] = nil
2122
+ end
2110
2123
  local keysBefore = table.clone(view)
2111
2124
  local function foldView()
2112
2125
  for key in data do
2113
- if key ~= Template.RESERVED_ROOT and view[key] == nil then
2126
+ if key ~= Template.RESERVED_ROOT and not sessionRootNames[key] and view[key] == nil then
2114
2127
  data[key] = nil
2115
2128
  end
2116
2129
  end
2117
2130
  for key, value in view do
2118
- if key ~= Template.RESERVED_ROOT then
2131
+ if key ~= Template.RESERVED_ROOT and not sessionRootNames[key] then
2119
2132
  data[key] = value
2120
2133
  end
2121
2134
  end
@@ -2137,6 +2150,25 @@ function Persistence.new(ctx: any)
2137
2150
  { Player = player }
2138
2151
  )
2139
2152
  end
2153
+ local sessionWrites: { string } = {}
2154
+ for name in sessionRootNames do
2155
+ if view[name] ~= nil then
2156
+ table.insert(sessionWrites, name)
2157
+ end
2158
+ end
2159
+ if #sessionWrites > 0 then
2160
+ table.sort(sessionWrites)
2161
+ local fields = table.concat(sessionWrites, ", ")
2162
+ Log.Warn(
2163
+ "Lifecycle",
2164
+ "ON_PLAYER_INIT_SESSION",
2165
+ `OnPlayerInit assigned Scribe.Session field(s) {fields}; the assignment was discarded. `
2166
+ .. "A Session field is built fresh each session and never saved, so the hook's table "
2167
+ .. "does not hold it: set it through its accessor once the player is Ready, or declare "
2168
+ .. "a saved field if OnPlayerInit should write it",
2169
+ { Player = player, Fields = fields }
2170
+ )
2171
+ end
2140
2172
  foldView()
2141
2173
  -- Exempt intentional removals from the first save's missing-key check.
2142
2174
  for key in keysBefore do
@@ -2542,6 +2574,7 @@ function Persistence.new(ctx: any)
2542
2574
  Queue = {},
2543
2575
  QueueIndex = {},
2544
2576
  SharedQueue = {},
2577
+ SharedIndex = {},
2545
2578
  MalformedCount = 0,
2546
2579
  OversizeCount = 0,
2547
2580
  FrameTokens = ctx.InboundFrameRate,
@@ -18,6 +18,7 @@ local Profile = require(Internal.Profile)
18
18
  local Replication = {}
19
19
 
20
20
  local HANDSHAKE_TIMEOUT = 10
21
+ local HANDSHAKE_TIMEOUT_LIVE = 60
21
22
  local MAX_OPS_PER_FRAME = 60000
22
23
  local REINIT_COOLDOWN = 5 -- seconds between snapshots to one client
23
24
  -- Per-client cap; excess replies send immediately.
@@ -121,6 +122,36 @@ function Replication.new(ctx: any)
121
122
  end
122
123
  end
123
124
 
125
+ -- Return true when a scalar Set replaces an earlier Set on the same path.
126
+ local function enqueue(queue: { Wire.Op }, index: { [string]: number }, op: Wire.Op, pathKey: string): boolean
127
+ if op.Kind == "Set" and op.Value ~= nil and type(op.Value) ~= "table" then
128
+ local existing = index[pathKey]
129
+ if
130
+ existing
131
+ and queue[existing]
132
+ and queue[existing].Kind == "Set"
133
+ and (queue[existing] :: any)._pk == pathKey
134
+ then
135
+ queue[existing] = op
136
+ return true
137
+ end
138
+ table.insert(queue, op)
139
+ index[pathKey] = #queue
140
+ return false
141
+ end
142
+ -- Later writes to this path or its children must stay after this op.
143
+ table.insert(queue, op)
144
+ index[pathKey] = nil
145
+ local descendantPrefix = pathKey .. "\31"
146
+ local prefixLen = #descendantPrefix
147
+ for k in index do
148
+ if string.sub(k, 1, prefixLen) == descendantPrefix then
149
+ index[k] = nil
150
+ end
151
+ end
152
+ return false
153
+ end
154
+
124
155
  function self.PushOp(entry: any, op: Wire.Op, schema: Template.SchemaNode?)
125
156
  local visibility = Template.OpVisibility(compiled, op, schema)
126
157
  if visibility == "ServerOnly" then
@@ -136,43 +167,15 @@ function Replication.new(ctx: any)
136
167
  (op :: any)._pk = pathKey
137
168
  if entry.QueueOpen then
138
169
  markDirty(entry)
139
- local queue: { Wire.Op } = entry.Queue
140
- if op.Kind == "Set" and op.Value ~= nil and type(op.Value) ~= "table" then
141
- -- Scalar leaf Set: coalesce consecutive writes to the same path in place.
142
- -- Supersession by whole-container writes is resolved at flush (compactOps).
143
- local existing = entry.QueueIndex[pathKey]
144
- if
145
- existing
146
- and queue[existing]
147
- and queue[existing].Kind == "Set"
148
- and (queue[existing] :: any)._pk == pathKey
149
- then
150
- queue[existing] = op
151
- Metrics.Add("OpsCoalesced")
152
- else
153
- table.insert(queue, op)
154
- entry.QueueIndex[pathKey] = #queue
155
- end
156
- else
157
- -- Whole-container writes (table Set, nil Set, Clear) and array ops append,
158
- -- and break scalar coalescing here and below: a later child Set would
159
- -- otherwise collapse into a preceding slot and be dropped as superseded.
160
- table.insert(queue, op)
161
- entry.QueueIndex[pathKey] = nil
162
- local descendantPrefix = pathKey .. "\31"
163
- local prefixLen = #descendantPrefix
164
- for k in entry.QueueIndex do
165
- if string.sub(k, 1, prefixLen) == descendantPrefix then
166
- entry.QueueIndex[k] = nil
167
- end
168
- end
170
+ if enqueue(entry.Queue, entry.QueueIndex, op, pathKey) then
171
+ Metrics.Add("OpsCoalesced")
169
172
  end
170
173
  end
171
174
  -- Before the snapshot is taken there is nothing to diff against: the snapshot
172
175
  -- about to be cloned carries this value, so queueing it would send it twice.
173
176
 
174
177
  if visibility == "Shared" then
175
- table.insert(entry.SharedQueue, op)
178
+ enqueue(entry.SharedQueue, entry.SharedIndex, op, pathKey)
176
179
  markDirty(entry)
177
180
  end
178
181
  end
@@ -634,6 +637,7 @@ function Replication.new(ctx: any)
634
637
  local function detachSharedQueue(entry: any): { Wire.Op }
635
638
  local shared: { Wire.Op } = entry.SharedQueue
636
639
  entry.SharedQueue = {}
640
+ entry.SharedIndex = {}
637
641
  return shared
638
642
  end
639
643
 
@@ -720,6 +724,7 @@ function Replication.new(ctx: any)
720
724
  --- frame cost can be timed around it.
721
725
  -- One queue for the whole server: a single writer, one frame to every ready client.
722
726
  local storeQueue: { Wire.Op } = {}
727
+ local storeIndex: { [string]: number } = {}
723
728
  -- Lets flushFrame skip the drain entirely. Read from the compiled, not from
724
729
  -- ctx.ServerStore, which is assigned after this constructor returns.
725
730
  local hasStore = compiled.Views.Store ~= nil
@@ -739,7 +744,9 @@ function Replication.new(ctx: any)
739
744
  -- with `(` after a call is ambiguous to Luau.
740
745
  local pathKey = Util.pathKey(op.Path);
741
746
  (op :: any)._pk = pathKey
742
- storeQueue[#storeQueue + 1] = op
747
+ if enqueue(storeQueue, storeIndex, op, pathKey) then
748
+ Metrics.Add("OpsCoalesced")
749
+ end
743
750
  end
744
751
 
745
752
  --- Encode whatever the store queued and broadcast it to every ready client.
@@ -781,6 +788,7 @@ function Replication.new(ctx: any)
781
788
  end
782
789
  local queue = compactOps(storeQueue)
783
790
  storeQueue = {}
791
+ storeIndex = {}
784
792
  return sendStoreOps(queue, except)
785
793
  end
786
794
 
@@ -969,6 +977,7 @@ function Replication.new(ctx: any)
969
977
  if hasStore and #storeQueue > 0 then
970
978
  local pending = compactOps(storeQueue)
971
979
  storeQueue = {}
980
+ storeIndex = {}
972
981
  sendStoreOps(pending, entry)
973
982
  end
974
983
  -- Per-root byte spans, filled by the encode, so the oversize warning can name
@@ -1051,6 +1060,10 @@ function Replication.new(ctx: any)
1051
1060
  -- handed a diff it has no mirror to apply to. broadcastBuffer skips unready
1052
1061
  -- entries, which is also what kept the Shared drain above safe.
1053
1062
  entry.HandshakeReady = true
1063
+ if not repair then
1064
+ -- An initial snapshot sent before OnEntryReady has zero wait.
1065
+ Metrics.Observe("HandshakeDuration", if entry.ReadyAt then Clock.Monotonic() - entry.ReadyAt else 0)
1066
+ end
1054
1067
  entry.InitDelivered = true
1055
1068
  -- Any pending repair request is met by this snapshot.
1056
1069
  entry.ResyncPending = false
@@ -1109,6 +1122,9 @@ function Replication.new(ctx: any)
1109
1122
 
1110
1123
  -- Handshake ---------------------------------------------------------------
1111
1124
 
1125
+ -- Any accepted Hello lowers later timeout reports to Debug.
1126
+ local helloSeen = false
1127
+
1112
1128
  local function onHello(entry: any, reader: Wire.Reader)
1113
1129
  local schemaHash = Wire.RU32(reader)
1114
1130
  -- The client sends its wire PROTOCOL_VERSION after the hash. A mismatch means
@@ -1116,11 +1132,14 @@ function Replication.new(ctx: any)
1116
1132
  -- closed, unlike the hash check below which the value-mode prefix keeps safe.
1117
1133
  local protocolVersion = Wire.RU8(reader)
1118
1134
  if protocolVersion ~= Wire.PROTOCOL_VERSION then
1119
- -- Metered as well as logged, so every refusal is countable.
1135
+ -- Count each refusal and log the first mismatch per session.
1120
1136
  Metrics.Add("ProtocolMismatch")
1121
- Log.Warn("Replication", "PROTOCOL_MISMATCH", "client wire protocol version differs from the server", {
1122
- Player = entry.Player,
1123
- })
1137
+ if not entry.HelloRefused then
1138
+ entry.HelloRefused = true
1139
+ Log.Warn("Replication", "PROTOCOL_MISMATCH", "client wire protocol version differs from the server", {
1140
+ Player = entry.Player,
1141
+ })
1142
+ end
1124
1143
  return
1125
1144
  end
1126
1145
  if schemaHash ~= compiled.Hash % 4294967296 then
@@ -1129,15 +1148,19 @@ function Replication.new(ctx: any)
1129
1148
  -- a server op lands on the wrong client key. The value-mode prefix keeps value
1130
1149
  -- decoding safe, not path remapping.
1131
1150
  Metrics.Add("SchemaMismatch")
1132
- Log.Warn(
1133
- "Replication",
1134
- "SCHEMA_MISMATCH",
1135
- "client derived a different schema than the server; refusing to replicate (template drift)",
1136
- { Player = entry.Player }
1137
- )
1151
+ if not entry.HelloRefused then
1152
+ entry.HelloRefused = true
1153
+ Log.Warn(
1154
+ "Replication",
1155
+ "SCHEMA_MISMATCH",
1156
+ "client derived a different schema than the server; refusing to replicate (template drift)",
1157
+ { Player = entry.Player }
1158
+ )
1159
+ end
1138
1160
  return
1139
1161
  end
1140
1162
  entry.HelloReceived = true
1163
+ helloSeen = true
1141
1164
  if entry.State == "Ready" then
1142
1165
  -- A repeated Hello re-Inits (client-driven resync), but a full snapshot
1143
1166
  -- encode is expensive, so throttle floods.
@@ -1161,7 +1184,47 @@ function Replication.new(ctx: any)
1161
1184
  end
1162
1185
  end
1163
1186
 
1187
+ local function checkHandshake(entry: any, final: boolean)
1188
+ if stopped or entry.TornDown or entry.HandshakeReady then
1189
+ return
1190
+ end
1191
+ if entry.HelloReceived then
1192
+ Log.Warn(
1193
+ "Replication",
1194
+ "INIT_UNDELIVERED",
1195
+ "the client sent Hello but its snapshot never reached the transport; check MaxOutboundBytes against what this transport will carry",
1196
+ {
1197
+ Player = entry.Player,
1198
+ }
1199
+ )
1200
+ elseif entry.HelloRefused then
1201
+ return -- mismatch already logged
1202
+ elseif not final then
1203
+ local remaining = entry.ReadyAt + HANDSHAKE_TIMEOUT_LIVE - Clock.Monotonic()
1204
+ Clock.Delay(math.max(remaining, 0), checkHandshake, entry, true)
1205
+ else
1206
+ Metrics.Add("HandshakeTimeouts")
1207
+ local context = { Player = entry.Player, Waited = Clock.Monotonic() - entry.ReadyAt }
1208
+ if helloSeen then
1209
+ Log.Debug(
1210
+ "Replication",
1211
+ "CLIENT_HANDSHAKE_TIMEOUT",
1212
+ "client has not sent Hello, though other clients of this server have; it is still loading or has stalled, and is answered when it asks",
1213
+ context
1214
+ )
1215
+ else
1216
+ Log.Warn(
1217
+ "Replication",
1218
+ "CLIENT_HANDSHAKE_TIMEOUT",
1219
+ "no client has sent Hello to this server, so replication never started; require the Scribe bundle on the client (a LocalScript), or check a custom client transport adapter",
1220
+ context
1221
+ )
1222
+ end
1223
+ end
1224
+ end
1225
+
1164
1226
  function self.OnEntryReady(entry: any)
1227
+ entry.ReadyAt = Clock.Monotonic()
1165
1228
  -- QueueOpen, not HandshakeReady: the question is whether a snapshot has already
1166
1229
  -- been started, which is the same question the re-Init throttle asks. The two
1167
1230
  -- reading different flags is how the gap opened.
@@ -1179,6 +1242,7 @@ function Replication.new(ctx: any)
1179
1242
  -- was queued is in the snapshot, and a write made during the send is the next flush's.
1180
1243
  local sharedOps = sharedSnapshotOps(entry)
1181
1244
  entry.SharedQueue = {}
1245
+ entry.SharedIndex = {}
1182
1246
  if #sharedOps > 0 then
1183
1247
  local ok, bytes = pcall(Wire.EncodeOpsFrame, Wire.Frames.SharedInit, compiled, sharedOps, function(w)
1184
1248
  Wire.F64(w, entry.UserId)
@@ -1192,32 +1256,8 @@ function Replication.new(ctx: any)
1192
1256
  end
1193
1257
  end
1194
1258
  end
1195
- Clock.Delay(HANDSHAKE_TIMEOUT, function()
1196
- if not entry.TornDown and not entry.HandshakeReady then
1197
- if entry.HelloReceived then
1198
- -- A different failure with the same symptom: the client did ask and the
1199
- -- answer could not be delivered. MaxOutboundBytes is named because a
1200
- -- transport refusing a payload this size is the one innocent cause.
1201
- Log.Warn(
1202
- "Replication",
1203
- "INIT_UNDELIVERED",
1204
- "the client sent Hello but its snapshot never reached the transport; check MaxOutboundBytes against what this transport will carry",
1205
- {
1206
- Player = entry.Player,
1207
- }
1208
- )
1209
- else
1210
- Log.Warn(
1211
- "Replication",
1212
- "CLIENT_HANDSHAKE_TIMEOUT",
1213
- "client never sent Hello, so replication never started; require the Scribe bundle on the client (a LocalScript), or check a custom client transport adapter",
1214
- {
1215
- Player = entry.Player,
1216
- }
1217
- )
1218
- end
1219
- end
1220
- end)
1259
+ -- Live clients get a second check for a missing Hello.
1260
+ Clock.Delay(HANDSHAKE_TIMEOUT, checkHandshake, entry, ctx.DevMode == true)
1221
1261
  end
1222
1262
 
1223
1263
  function self.OnEntryRemoved(entry: any)
@@ -474,8 +474,14 @@ function Timed.new(ctx: any)
474
474
 
475
475
  function self.OnLoad(entry: any)
476
476
  restoreDeadlines(entry)
477
- sweepEntry(entry)
478
477
  local store = timedStore(entry)
478
+ -- Session values reset on join, so discard their saved deadlines.
479
+ for pathKey in store or {} do
480
+ if not Template.PersistOf(compiled, string.split(pathKey, "\31")) then
481
+ setTimed(entry, pathKey, nil)
482
+ end
483
+ end
484
+ sweepEntry(entry)
479
485
  if next(visibleFields) ~= nil then
480
486
  local visible: { [string]: number } = {}
481
487
  for pathKey, expiry in store or {} do
package/src/Types.luau CHANGED
@@ -247,6 +247,7 @@ export type LogCode =
247
247
  | "LISTENER_ERROR"
248
248
  | "ON_PLAYER_INIT_ERROR"
249
249
  | "ON_PLAYER_INIT_LEDGER"
250
+ | "ON_PLAYER_INIT_SESSION"
250
251
  | "PLAYER_LEAVING_HOOK_SLOW"
251
252
  | "SANDBOXED"
252
253
  | "SERVER_STARTED"
@@ -413,7 +414,7 @@ export type LeaderboardConfig = {
413
414
  export type ProductConfig = {
414
415
  Id: number,
415
416
  Category: string?,
416
- Grant: ((data: any) -> ())?,
417
+ Grant: ((data: any, player: Player) -> ())?,
417
418
  Grants: string?,
418
419
  PaidRandom: boolean?,
419
420
  }
@@ -428,7 +429,7 @@ export type PurchaseSpec = {
428
429
  Cost: { Path: string, Amount: number | string | { M: number, E: number } },
429
430
  Category: string?,
430
431
  ItemId: string,
431
- Grant: ((data: any) -> ())?,
432
+ Grant: ((data: any, player: Player) -> ())?,
432
433
  Meta: { [string]: any }?,
433
434
  -- Optional. Two calls carrying the same key apply once: the repeat returns the
434
435
  -- original outcome without debiting or granting again. A FAILED purchase claims
package/src/init.luau CHANGED
@@ -1414,8 +1414,7 @@ type function BuildServerDataType(T, P, S, Names: type?)
1414
1414
  add("GrantPerk", fn({ P, ts.string }, {}))
1415
1415
  add("RevokePerk", fn({ P, ts.string }, {}))
1416
1416
 
1417
- -- Purchase spec: Cost.Path is the template's numeric-leaf path union and
1418
- -- Grant receives the typed accessor tree.
1417
+ -- Cost.Path accepts numeric leaves. Grant receives the typed tree and player.
1419
1418
  local costProps: { [type]: type } = {}
1420
1419
  -- Include Big currency paths.
1421
1420
  costProps[ts.singleton("Path")] = StatPathsType(T, ts.singleton(true))
@@ -1425,7 +1424,7 @@ type function BuildServerDataType(T, P, S, Names: type?)
1425
1424
  purchaseProps[ts.singleton("Cost")] = ts.newtable(costProps, nil, nil)
1426
1425
  purchaseProps[ts.singleton("Category")] = optional(ts.string)
1427
1426
  purchaseProps[ts.singleton("ItemId")] = ts.string
1428
- purchaseProps[ts.singleton("Grant")] = optional(fn({ node }, {}))
1427
+ purchaseProps[ts.singleton("Grant")] = optional(fn({ node, P }, {}))
1429
1428
  purchaseProps[ts.singleton("Meta")] = optAnyTable
1430
1429
  purchaseProps[ts.singleton("IdempotencyKey")] = optional(ts.string)
1431
1430
  purchaseProps[ts.singleton("PaidRandom")] = optional(ts.boolean)
@@ -1541,8 +1540,9 @@ export type CFrameMeta = { Precision: "exact"? }
1541
1540
  -- Container declarator options. Not generic in the element type on purpose: an
1542
1541
  -- element-typed option would let Luau infer the element type from it rather than
1543
1542
  -- from `shape`, silently redefining the field.
1544
- export type ArrayOpts = { MaxItems: number?, Evict: ("Front" | "Back")? }
1545
- export type SetOpts = { MaxItems: number? }
1543
+ -- Read-only fields accept partial option literals.
1544
+ export type ArrayOpts = { read MaxItems: number?, read Evict: ("Front" | "Back")? }
1545
+ export type SetOpts = { read MaxItems: number? }
1546
1546
  export type CooldownOptions = { IncludeOfflineTime: boolean? }
1547
1547
  export type MapKeyType = "integer" | "string"
1548
1548
  -- What a Scribe.Big field reads back, which is also what the declarator returns.
@@ -1617,7 +1617,7 @@ type function MapShape(K, V)
1617
1617
  return out
1618
1618
  end
1619
1619
  export type MapOf<K, V> = MapShape<K, V>
1620
- export type DictOpts = { MaxKeys: number?, MaxKeyLength: number? }
1620
+ export type DictOpts = { read MaxKeys: number?, read MaxKeyLength: number? }
1621
1621
 
1622
1622
  -- Template-aware config types. Annotate a config local with one and `Stat` / `Cost.Path`
1623
1623
  -- become the template's numeric leaf-path union while `Grant` receives the typed accessor
@@ -1643,7 +1643,7 @@ export type LeaderboardConfig<T = any> = {
1643
1643
  export type ProductConfig<T = any> = {
1644
1644
  Id: number,
1645
1645
  Category: string?,
1646
- Grant: ((data: BuildGrantDataType<T, NodeFunctionNames>) -> ())?,
1646
+ Grant: ((data: BuildGrantDataType<T, NodeFunctionNames>, player: Player) -> ())?,
1647
1647
  Grants: string?,
1648
1648
  PaidRandom: boolean?,
1649
1649
  }
@@ -1653,7 +1653,7 @@ export type PurchaseSpec<T = any> = {
1653
1653
  Cost: { Path: StatPathsType<T, true>, Amount: number | string | BigValue },
1654
1654
  Category: string?,
1655
1655
  ItemId: string,
1656
- Grant: ((data: BuildGrantDataType<T, NodeFunctionNames>) -> ())?,
1656
+ Grant: ((data: BuildGrantDataType<T, NodeFunctionNames>, player: Player) -> ())?,
1657
1657
  Meta: { [string]: any }?,
1658
1658
  IdempotencyKey: string?,
1659
1659
  PaidRandom: boolean?,
@@ -1680,7 +1680,7 @@ type LeaderboardConfigLoose = {
1680
1680
  type ProductConfigLoose = {
1681
1681
  read Id: number,
1682
1682
  read Category: string?,
1683
- read Grant: ((data: any) -> ())?,
1683
+ read Grant: ((data: any, player: Player) -> ())?,
1684
1684
  read Grants: string?,
1685
1685
  read PaidRandom: boolean?,
1686
1686
  }
package/types/api.d.ts CHANGED
@@ -18,7 +18,8 @@ export interface LeaderboardConfig<T = unknown> {
18
18
  export interface ProductConfig<T = unknown> {
19
19
  Id: number;
20
20
  Category?: string;
21
- Grant?: (this: void, data: PlayerData<T>) => void;
21
+ /** Runs on the buyer's data, or the recipient's for gifts. */
22
+ Grant?: (this: void, data: PlayerData<T>, player: Player) => void;
22
23
  Grants?: string;
23
24
  PaidRandom?: boolean;
24
25
  }
@@ -27,7 +28,8 @@ export interface PurchaseSpec<T = unknown> {
27
28
  Cost: { Path: NumericPaths<T, true>; Amount: BigOperand };
28
29
  Category?: string;
29
30
  ItemId: string;
30
- Grant?: (this: void, data: PlayerData<T>) => void;
31
+ /** Runs on the buyer's data. */
32
+ Grant?: (this: void, data: PlayerData<T>, player: Player) => void;
31
33
  Meta?: UnknownRecord;
32
34
  IdempotencyKey?: string;
33
35
  PaidRandom?: boolean;
@@ -169,7 +171,7 @@ export interface ServerAPI<T, C = {}> {
169
171
  }
170
172
  export type ServerData<T, S = {}, C = {}> = ServerAPI<T, C> & ServerStoreMember<S>;
171
173
 
172
- /** Partial records for Mock; arrays and Roblox engine datatypes remain whole values. */
174
+ /** Mock merges records, dictionaries and maps by key. Arrays, sets, Flags and engine datatypes replace whole values. */
173
175
  export type MockValues<T> = T extends Datatype | buffer | BigValue | ReadonlyArray<unknown> | ReadonlyMap<unknown, unknown> ? T : T extends object ? { [K in keyof T]?: MockValues<T[K]> } : T;
174
176
  export interface ClientAPI<T, C = {}> {
175
177
  /** Reads snapshot readiness without yielding. */
@@ -200,7 +202,7 @@ export interface ClientAPI<T, C = {}> {
200
202
  readonly Owns: (this: void, key: string) => boolean;
201
203
  /** Waits for the server's initial ownership sync before reading the mirror. */
202
204
  readonly OwnsAsync: (this: void, key: string, timeout?: number) => boolean;
203
- /** Reports ownership now and on changes; returns a disconnect function. */
205
+ /** Returns a disconnect immediately. Reports current ownership once loaded and on changes. */
204
206
  readonly ObserveOwned: (this: void, key: string, callback: (this: void, owned: boolean) => void) => Disconnect;
205
207
  /** Fires for ownership changes after the initial baseline. */
206
208
  readonly OnOwnershipChanged: Signal<[string, boolean]>;
@@ -224,11 +226,11 @@ export interface ClientAPI<T, C = {}> {
224
226
  readonly GetProductState: (this: void, name: string) => ProductState;
225
227
  /** Reports shop state now and on changes; returns a disconnect function. */
226
228
  readonly ObserveProductState: (this: void, name: string, callback: (this: void, state: ProductState) => void) => Disconnect;
227
- /** Reads the owner's replicated save status. */
229
+ /** Waits for load, then reads the owner's replicated save status. */
228
230
  readonly GetSaveInfo: (this: void) => SaveInfo;
229
- /** Reads unassigned gift credits from the local mirror. */
231
+ /** Waits for load, then reads unassigned gift credits. */
230
232
  readonly GetGiftCredits: (this: void) => { [product: string]: number };
231
- /** Reads purchase history only when its replication is enabled. */
233
+ /** Waits for load, then reads the enabled purchase logs. */
232
234
  readonly GetPurchases: (this: void, filter?: PurchaseFilter) => PurchaseEntry[];
233
235
  /** Seeds local mirror data in edit mode only. */
234
236
  readonly Mock: (this: void, values?: MockValues<InputOf<ClientSchema<T>>>, state?: MockState) => void;
package/types/common.d.ts CHANGED
@@ -218,6 +218,7 @@ export type LogCode =
218
218
  | "LISTENER_ERROR"
219
219
  | "ON_PLAYER_INIT_ERROR"
220
220
  | "ON_PLAYER_INIT_LEDGER"
221
+ | "ON_PLAYER_INIT_SESSION"
221
222
  | "PLAYER_LEAVING_HOOK_SLOW"
222
223
  | "SANDBOXED"
223
224
  | "SERVER_STARTED"