@oxy.so/core 4.5.0-oxy-one.0 → 4.5.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.
Files changed (285) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/HttpService.js +63 -19
  3. package/dist/cjs/api/accounts.js +10 -3
  4. package/dist/cjs/api/agency.js +3 -1
  5. package/dist/cjs/api/apps.js +15 -4
  6. package/dist/cjs/api/assets.js +49 -12
  7. package/dist/cjs/api/auth.js +37 -11
  8. package/dist/cjs/api/billing.js +24 -7
  9. package/dist/cjs/api/civic.js +14 -4
  10. package/dist/cjs/api/follows.js +9 -2
  11. package/dist/cjs/api/identity.js +31 -9
  12. package/dist/cjs/api/nodes.js +3 -1
  13. package/dist/cjs/api/privacy.js +8 -2
  14. package/dist/cjs/api/session.js +15 -4
  15. package/dist/cjs/api/store.js +15 -5
  16. package/dist/cjs/api/topics.js +10 -3
  17. package/dist/cjs/api/users.js +16 -4
  18. package/dist/cjs/boot/sessionColdBoot.js +40 -13
  19. package/dist/cjs/constants/version.js +6 -6
  20. package/dist/cjs/crypto/identityMarker.js +3 -1
  21. package/dist/cjs/crypto/identityProof.js +6 -1
  22. package/dist/cjs/crypto/keyManager.js +87 -32
  23. package/dist/cjs/crypto/recoveryPhrase.js +2 -2
  24. package/dist/cjs/crypto/signatureService.js +3 -4
  25. package/dist/cjs/i18n/index.js +16 -3
  26. package/dist/cjs/i18n/locales/ar-SA.js +366 -366
  27. package/dist/cjs/i18n/locales/ca-ES.js +366 -366
  28. package/dist/cjs/i18n/locales/de-DE.js +366 -366
  29. package/dist/cjs/i18n/locales/en-US.js +1994 -1994
  30. package/dist/cjs/i18n/locales/es-ES.js +1994 -1994
  31. package/dist/cjs/i18n/locales/fr-FR.js +366 -366
  32. package/dist/cjs/i18n/locales/it-IT.js +366 -366
  33. package/dist/cjs/i18n/locales/ja-JP.js +366 -366
  34. package/dist/cjs/i18n/locales/ko-KR.js +366 -366
  35. package/dist/cjs/i18n/locales/pt-PT.js +366 -366
  36. package/dist/cjs/i18n/locales/zh-CN.js +366 -366
  37. package/dist/cjs/inference/OxyInferenceClient.js +12 -18
  38. package/dist/cjs/models/interfaces.js +11 -11
  39. package/dist/cjs/server/OxyServer.js +86 -28
  40. package/dist/cjs/server/agentAccount.js +6 -2
  41. package/dist/cjs/server/aliaMachineCredential.js +39 -14
  42. package/dist/cjs/server/auth.js +5 -4
  43. package/dist/cjs/server/capabilityTicket.js +5 -5
  44. package/dist/cjs/server/index.js +2 -1
  45. package/dist/cjs/server/liveCapabilityTicket.js +4 -1
  46. package/dist/cjs/server/middleware.js +61 -42
  47. package/dist/cjs/server/namespaces.js +28 -7
  48. package/dist/cjs/server/requesterAssertion.js +36 -30
  49. package/dist/cjs/server/serviceTokenLifetime.js +7 -4
  50. package/dist/cjs/server/traffic.js +53 -14
  51. package/dist/cjs/server/trafficNodeHttp.js +33 -8
  52. package/dist/cjs/server/workloadIdentity.client.js +4 -0
  53. package/dist/cjs/server/workloadIdentity.js +28 -1
  54. package/dist/cjs/session/SessionClient.js +54 -17
  55. package/dist/cjs/session/accountDelegationAccess.js +4 -6
  56. package/dist/cjs/session/accountDialogController.js +1 -1
  57. package/dist/cjs/session/authStateStore.js +18 -9
  58. package/dist/cjs/session/identityPin.js +6 -2
  59. package/dist/cjs/session/refresh.js +81 -23
  60. package/dist/cjs/session/sharedDeviceCredential.js +28 -15
  61. package/dist/cjs/shared/utils/errorUtils.js +1 -1
  62. package/dist/cjs/shared/utils/networkUtils.js +1 -1
  63. package/dist/cjs/shared/utils/themeUtils.js +1 -1
  64. package/dist/cjs/utils/accountCacheSweep.js +3 -1
  65. package/dist/cjs/utils/accountUtils.js +1 -3
  66. package/dist/cjs/utils/asyncUtils.js +1 -1
  67. package/dist/cjs/utils/authHelpers.js +2 -1
  68. package/dist/cjs/utils/avatarUtils.js +4 -2
  69. package/dist/cjs/utils/cache.js +1 -1
  70. package/dist/cjs/utils/cacheKey.js +3 -1
  71. package/dist/cjs/utils/deviceManager.js +4 -4
  72. package/dist/cjs/utils/errorUtils.js +6 -4
  73. package/dist/cjs/utils/languageUtils.js +404 -57
  74. package/dist/cjs/utils/profileLinks.js +1 -3
  75. package/dist/cjs/utils/requestUtils.js +7 -1
  76. package/dist/cjs/utils/userIdentity.js +1 -1
  77. package/dist/cjs/utils/validationUtils.js +5 -6
  78. package/dist/esm/HttpService.js +64 -20
  79. package/dist/esm/api/accounts.js +11 -4
  80. package/dist/esm/api/agency.js +3 -1
  81. package/dist/esm/api/apps.js +15 -4
  82. package/dist/esm/api/assets.js +49 -12
  83. package/dist/esm/api/auth.js +37 -11
  84. package/dist/esm/api/billing.js +25 -8
  85. package/dist/esm/api/civic.js +14 -4
  86. package/dist/esm/api/follows.js +9 -2
  87. package/dist/esm/api/identity.js +31 -9
  88. package/dist/esm/api/nodes.js +3 -1
  89. package/dist/esm/api/privacy.js +8 -2
  90. package/dist/esm/api/session.js +15 -4
  91. package/dist/esm/api/store.js +15 -5
  92. package/dist/esm/api/topics.js +10 -3
  93. package/dist/esm/api/users.js +16 -4
  94. package/dist/esm/boot/sessionColdBoot.js +41 -14
  95. package/dist/esm/constants/version.js +6 -6
  96. package/dist/esm/crypto/identityMarker.js +3 -1
  97. package/dist/esm/crypto/identityProof.js +6 -1
  98. package/dist/esm/crypto/internal.js +1 -1
  99. package/dist/esm/crypto/keyManager.js +87 -32
  100. package/dist/esm/crypto/recoveryPhrase.js +2 -2
  101. package/dist/esm/crypto/signatureService.js +3 -4
  102. package/dist/esm/i18n/index.js +16 -3
  103. package/dist/esm/i18n/locales/ar-SA.js +366 -366
  104. package/dist/esm/i18n/locales/ca-ES.js +366 -366
  105. package/dist/esm/i18n/locales/de-DE.js +366 -366
  106. package/dist/esm/i18n/locales/en-US.js +1994 -1994
  107. package/dist/esm/i18n/locales/es-ES.js +1994 -1994
  108. package/dist/esm/i18n/locales/fr-FR.js +366 -366
  109. package/dist/esm/i18n/locales/it-IT.js +366 -366
  110. package/dist/esm/i18n/locales/ja-JP.js +366 -366
  111. package/dist/esm/i18n/locales/ko-KR.js +366 -366
  112. package/dist/esm/i18n/locales/pt-PT.js +366 -366
  113. package/dist/esm/i18n/locales/zh-CN.js +366 -366
  114. package/dist/esm/index.js +1 -1
  115. package/dist/esm/inference/OxyInferenceClient.js +13 -19
  116. package/dist/esm/models/interfaces.js +11 -11
  117. package/dist/esm/server/OxyServer.js +87 -29
  118. package/dist/esm/server/agentAccount.js +6 -2
  119. package/dist/esm/server/aliaMachineCredential.js +39 -14
  120. package/dist/esm/server/auth.js +6 -5
  121. package/dist/esm/server/capabilityTicket.js +6 -6
  122. package/dist/esm/server/index.js +5 -5
  123. package/dist/esm/server/liveCapabilityTicket.js +6 -3
  124. package/dist/esm/server/middleware.js +62 -43
  125. package/dist/esm/server/namespaces.js +31 -10
  126. package/dist/esm/server/requesterAssertion.js +36 -30
  127. package/dist/esm/server/serviceTokenLifetime.js +7 -4
  128. package/dist/esm/server/traffic.js +55 -16
  129. package/dist/esm/server/trafficNodeHttp.js +34 -9
  130. package/dist/esm/server/userInvalidation.js +1 -1
  131. package/dist/esm/server/workloadIdentity.client.js +3 -0
  132. package/dist/esm/server/workloadIdentity.js +27 -1
  133. package/dist/esm/session/SessionClient.js +54 -17
  134. package/dist/esm/session/accountDelegationAccess.js +5 -7
  135. package/dist/esm/session/accountDialogController.js +1 -1
  136. package/dist/esm/session/authStateStore.js +18 -9
  137. package/dist/esm/session/identityPin.js +6 -2
  138. package/dist/esm/session/refresh.js +82 -24
  139. package/dist/esm/session/sharedDeviceCredential.js +28 -15
  140. package/dist/esm/shared/utils/errorUtils.js +1 -1
  141. package/dist/esm/shared/utils/networkUtils.js +1 -1
  142. package/dist/esm/shared/utils/themeUtils.js +1 -1
  143. package/dist/esm/utils/accountCacheSweep.js +3 -1
  144. package/dist/esm/utils/accountUtils.js +1 -3
  145. package/dist/esm/utils/asyncUtils.js +1 -1
  146. package/dist/esm/utils/authHelpers.js +2 -1
  147. package/dist/esm/utils/avatarUtils.js +4 -2
  148. package/dist/esm/utils/cache.js +1 -1
  149. package/dist/esm/utils/cacheKey.js +3 -1
  150. package/dist/esm/utils/deviceManager.js +4 -4
  151. package/dist/esm/utils/errorUtils.js +6 -4
  152. package/dist/esm/utils/languageUtils.js +404 -57
  153. package/dist/esm/utils/profileLinks.js +1 -3
  154. package/dist/esm/utils/requestUtils.js +7 -1
  155. package/dist/esm/utils/userIdentity.js +1 -1
  156. package/dist/esm/utils/validationUtils.js +5 -6
  157. package/dist/types/HttpService.d.ts +1 -1
  158. package/dist/types/api/accounts.d.ts +1 -1
  159. package/dist/types/api/apps.d.ts +4 -4
  160. package/dist/types/api/assets.d.ts +2 -0
  161. package/dist/types/api/auth.d.ts +8 -3
  162. package/dist/types/crypto/internal.d.ts +1 -1
  163. package/dist/types/index.d.ts +4 -4
  164. package/dist/types/server/index.d.ts +6 -6
  165. package/dist/types/server/requesterAssertion.d.ts +2 -2
  166. package/dist/types/server/workloadIdentity.client.d.ts +5 -1
  167. package/dist/types/server/workloadIdentity.d.ts +26 -0
  168. package/dist/types/session/accountDelegationAccess.d.ts +1 -1
  169. package/dist/types/session/index.d.ts +1 -1
  170. package/dist/types/utils/userIdentity.d.ts +1 -1
  171. package/dist/types/utils/validationUtils.d.ts +4 -5
  172. package/package.json +2 -3
  173. package/src/HttpService.ts +183 -53
  174. package/src/OxyServices.errors.ts +7 -3
  175. package/src/OxyServices.ts +6 -2
  176. package/src/api/accounts.ts +76 -26
  177. package/src/api/agency.ts +24 -9
  178. package/src/api/appData.ts +12 -2
  179. package/src/api/apps.ts +81 -31
  180. package/src/api/assets.ts +122 -40
  181. package/src/api/auth.ts +154 -79
  182. package/src/api/billing.ts +112 -65
  183. package/src/api/civic.ts +61 -19
  184. package/src/api/contacts.ts +4 -1
  185. package/src/api/devices.ts +54 -21
  186. package/src/api/follows.ts +88 -31
  187. package/src/api/identity.ts +101 -33
  188. package/src/api/linkedAccounts.ts +26 -8
  189. package/src/api/nodes.ts +18 -6
  190. package/src/api/notifications.ts +26 -6
  191. package/src/api/privacy.ts +42 -8
  192. package/src/api/reputation.ts +18 -7
  193. package/src/api/session.ts +23 -5
  194. package/src/api/store.ts +81 -31
  195. package/src/api/topics.ts +18 -6
  196. package/src/api/users.ts +98 -35
  197. package/src/boot/sessionColdBoot.ts +60 -19
  198. package/src/civic/payloads.ts +1 -4
  199. package/src/client/context.ts +6 -1
  200. package/src/constants/version.ts +7 -6
  201. package/src/crypto/aead.ts +1 -5
  202. package/src/crypto/ecdh.ts +1 -4
  203. package/src/crypto/identityDerivations.ts +5 -1
  204. package/src/crypto/identityMarker.ts +3 -1
  205. package/src/crypto/identityProof.ts +6 -1
  206. package/src/crypto/index.ts +11 -11
  207. package/src/crypto/internal.ts +6 -1
  208. package/src/crypto/keyManager.ts +348 -98
  209. package/src/crypto/recoveryPhrase.ts +14 -9
  210. package/src/crypto/registrationPow.ts +1 -1
  211. package/src/crypto/signatureService.ts +14 -6
  212. package/src/i18n/accountCategoryLabels.ts +1 -4
  213. package/src/i18n/accountRoleLabels.ts +1 -4
  214. package/src/i18n/index.ts +25 -7
  215. package/src/i18n/locales/ar-SA.ts +375 -366
  216. package/src/i18n/locales/ca-ES.ts +382 -366
  217. package/src/i18n/locales/de-DE.ts +387 -366
  218. package/src/i18n/locales/en-US.ts +2034 -1994
  219. package/src/i18n/locales/es-ES.ts +2043 -1994
  220. package/src/i18n/locales/fr-FR.ts +387 -366
  221. package/src/i18n/locales/it-IT.ts +380 -366
  222. package/src/i18n/locales/ja-JP.ts +380 -366
  223. package/src/i18n/locales/ko-KR.ts +377 -366
  224. package/src/i18n/locales/pt-PT.ts +383 -366
  225. package/src/i18n/locales/zh-CN.ts +373 -366
  226. package/src/i18n/trustTierLabels.ts +1 -4
  227. package/src/index.ts +371 -349
  228. package/src/inference/OxyInferenceClient.ts +784 -780
  229. package/src/models/interfaces.ts +30 -27
  230. package/src/server/OxyServer.ts +227 -68
  231. package/src/server/agentAccount.ts +8 -2
  232. package/src/server/aliaMachineCredential.ts +57 -16
  233. package/src/server/auth.ts +9 -5
  234. package/src/server/capabilityTicket.ts +30 -21
  235. package/src/server/index.ts +29 -6
  236. package/src/server/liveCapabilityTicket.ts +31 -9
  237. package/src/server/middleware.ts +212 -121
  238. package/src/server/namespaces.ts +247 -94
  239. package/src/server/rateLimit.ts +2 -4
  240. package/src/server/requesterAssertion.ts +93 -54
  241. package/src/server/serviceTokenLifetime.ts +9 -4
  242. package/src/server/traffic.ts +117 -23
  243. package/src/server/trafficNodeHttp.ts +61 -14
  244. package/src/server/userInvalidation.ts +1 -4
  245. package/src/server/workloadIdentity.client.ts +12 -1
  246. package/src/server/workloadIdentity.ts +52 -5
  247. package/src/session/SessionClient.ts +170 -49
  248. package/src/session/accountDelegationAccess.ts +24 -31
  249. package/src/session/accountDialogController.ts +59 -14
  250. package/src/session/accountSwitchTargets.ts +10 -15
  251. package/src/session/authStateStore.ts +121 -81
  252. package/src/session/deviceDirectory.ts +1 -3
  253. package/src/session/identityPin.ts +10 -11
  254. package/src/session/identitySession.ts +3 -1
  255. package/src/session/index.ts +87 -82
  256. package/src/session/refresh.ts +138 -44
  257. package/src/session/sessionClientHost.ts +1 -3
  258. package/src/session/sharedDeviceCredential.ts +35 -14
  259. package/src/session/socketLoader.ts +9 -2
  260. package/src/shared/utils/errorUtils.ts +5 -2
  261. package/src/shared/utils/networkUtils.ts +5 -8
  262. package/src/shared/utils/themeUtils.ts +2 -6
  263. package/src/types/buffer.d.ts +66 -21
  264. package/src/types/expo-secure-store.d.ts +5 -1
  265. package/src/utils/accountCacheSweep.ts +4 -5
  266. package/src/utils/accountUtils.ts +107 -108
  267. package/src/utils/apiUtils.ts +3 -3
  268. package/src/utils/asyncUtils.ts +2 -2
  269. package/src/utils/authHelpers.ts +10 -5
  270. package/src/utils/avatarUtils.ts +11 -6
  271. package/src/utils/cache.ts +9 -10
  272. package/src/utils/cacheKey.ts +5 -1
  273. package/src/utils/coldBoot.ts +1 -3
  274. package/src/utils/commonsDelivery.ts +1 -4
  275. package/src/utils/deviceManager.ts +15 -14
  276. package/src/utils/errorUtils.ts +68 -86
  277. package/src/utils/languageUtils.ts +407 -58
  278. package/src/utils/oauthPkce.ts +1 -4
  279. package/src/utils/platform.ts +0 -1
  280. package/src/utils/profileLinks.ts +2 -5
  281. package/src/utils/requestUtils.ts +18 -14
  282. package/src/utils/sessionUtils.ts +34 -33
  283. package/src/utils/userHandle.ts +3 -1
  284. package/src/utils/userIdentity.ts +1 -1
  285. package/src/utils/validationUtils.ts +11 -9
@@ -69,7 +69,10 @@ function readLocalDeviceCredential(state) {
69
69
  */
70
70
  function normalizeSharedDeviceSessionRead(raw) {
71
71
  if (!raw || typeof raw !== 'object') {
72
- return { state: 'unavailable', cause: new Error('shared device session bridge returned a non-object') };
72
+ return {
73
+ state: 'unavailable',
74
+ cause: new Error('shared device session bridge returned a non-object'),
75
+ };
73
76
  }
74
77
  const payload = raw;
75
78
  if (payload.status === 'absent') {
@@ -94,7 +97,10 @@ function normalizeSharedDeviceSessionRead(raw) {
94
97
  }
95
98
  if (payload.status === 'unavailable') {
96
99
  const reason = typeof payload.reason === 'string' ? payload.reason : 'unknown';
97
- return { state: 'unavailable', cause: new Error(`shared device session slot unavailable: ${reason}`) };
100
+ return {
101
+ state: 'unavailable',
102
+ cause: new Error(`shared device session slot unavailable: ${reason}`),
103
+ };
98
104
  }
99
105
  return {
100
106
  state: 'unavailable',
@@ -221,19 +227,25 @@ function createSharedMirroringAuthStateStore(deps) {
221
227
  ...local,
222
228
  load: () => local.load(),
223
229
  clear: () => local.clear(),
224
- ...(local.saveIfCurrent ? { saveIfCurrent: async (state, guard) => {
225
- const committed = await local.saveIfCurrent?.(state, guard);
226
- if (!committed)
227
- return false;
228
- const credential = readLocalDeviceCredential(state);
229
- if (credential && guard.isCurrent()) {
230
- try {
231
- await publishProvenDeviceCredential({ shared, credential });
230
+ ...(local.saveIfCurrent
231
+ ? {
232
+ saveIfCurrent: async (state, guard) => {
233
+ const committed = await local.saveIfCurrent?.(state, guard);
234
+ if (!committed)
235
+ return false;
236
+ const credential = readLocalDeviceCredential(state);
237
+ if (credential && guard.isCurrent()) {
238
+ try {
239
+ await publishProvenDeviceCredential({ shared, credential });
240
+ }
241
+ catch {
242
+ /* Local durability already verified. */
243
+ }
232
244
  }
233
- catch { /* Local durability already verified. */ }
234
- }
235
- return true;
236
- } } : {}),
245
+ return true;
246
+ },
247
+ }
248
+ : {}),
237
249
  save: async (state) => {
238
250
  // The durable local write is the contract this store owes its caller —
239
251
  // run it first and report ITS result, unchanged. The mirror is additive.
@@ -249,7 +261,8 @@ function createSharedMirroringAuthStateStore(deps) {
249
261
  }
250
262
  try {
251
263
  const outcome = await publishProvenDeviceCredential({ shared, credential });
252
- if (outcome.status === 'published' || (outcome.status === 'skipped' && outcome.reason === 'already-current')) {
264
+ if (outcome.status === 'published' ||
265
+ (outcome.status === 'skipped' && outcome.reason === 'already-current')) {
253
266
  mirrored = credential;
254
267
  }
255
268
  }
@@ -168,7 +168,7 @@ const isNetworkError = (error) => {
168
168
  return true;
169
169
  // Message-based detection
170
170
  const message = (0, exports.getErrorMessage)(error, '').toLowerCase();
171
- return message.includes('network') || message.includes('connection') || message.includes('timeout');
171
+ return (message.includes('network') || message.includes('connection') || message.includes('timeout'));
172
172
  };
173
173
  exports.isNetworkError = isNetworkError;
174
174
  /**
@@ -143,7 +143,7 @@ exports.shouldAllowRequest = shouldAllowRequest;
143
143
  * await delay(1000); // Wait 1 second
144
144
  * ```
145
145
  */
146
- const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
146
+ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
147
147
  exports.delay = delay;
148
148
  /**
149
149
  * Executes a function with exponential backoff retry.
@@ -102,5 +102,5 @@ exports.systemPrefersDarkMode = systemPrefersDarkMode;
102
102
  * const theme = getSystemColorScheme();
103
103
  * ```
104
104
  */
105
- const getSystemColorScheme = () => (0, exports.systemPrefersDarkMode)() ? 'dark' : 'light';
105
+ const getSystemColorScheme = () => ((0, exports.systemPrefersDarkMode)() ? 'dark' : 'light');
106
106
  exports.getSystemColorScheme = getSystemColorScheme;
@@ -70,7 +70,9 @@ function oxyAccountDetailCacheKey(accountId) {
70
70
  */
71
71
  function evictOxyAccountForestCache(http, accountId) {
72
72
  http.invalidateCache({
73
- keys: accountId ? [exports.OXY_ACCOUNT_LIST_CACHE_KEY, oxyAccountDetailCacheKey(accountId)] : [exports.OXY_ACCOUNT_LIST_CACHE_KEY],
73
+ keys: accountId
74
+ ? [exports.OXY_ACCOUNT_LIST_CACHE_KEY, oxyAccountDetailCacheKey(accountId)]
75
+ : [exports.OXY_ACCOUNT_LIST_CACHE_KEY],
74
76
  prefixes: [exports.OXY_ACCOUNT_LIST_CACHE_QUERY_PREFIX],
75
77
  });
76
78
  }
@@ -106,9 +106,7 @@ exports.buildAccountsArray = buildAccountsArray;
106
106
  const createQuickAccount = (sessionId, userData, existingAccount, getFileDownloadUrl) => {
107
107
  const nameObj = userData.name && typeof userData.name === 'object' ? userData.name : undefined;
108
108
  const apiDisplayName = typeof nameObj?.displayName === 'string' ? nameObj.displayName.trim() : '';
109
- const displayName = apiDisplayName ||
110
- (0, userHandle_1.getNormalizedUserHandle)(userData) ||
111
- (0, exports.getAccountDisplayName)(null);
109
+ const displayName = apiDisplayName || (0, userHandle_1.getNormalizedUserHandle)(userData) || (0, exports.getAccountDisplayName)(null);
112
110
  const userId = userData.id || (typeof userData._id === 'string' ? userData._id : userData._id?.toString());
113
111
  // Preserve existing avatarUrl if avatar hasn't changed (prevents image reload)
114
112
  let avatarUrl;
@@ -115,7 +115,7 @@ async function retryAsync(operation, maxRetriesOrOptions = 3, baseDelayArg = 100
115
115
  if (deadline !== undefined && Date.now() + delay >= deadline) {
116
116
  break;
117
117
  }
118
- await new Promise(resolve => setTimeout(resolve, delay));
118
+ await new Promise((resolve) => setTimeout(resolve, delay));
119
119
  }
120
120
  }
121
121
  throw lastError;
@@ -50,7 +50,8 @@ async function ensureValidToken(oxyServices, _activeSessionId, syncSession) {
50
50
  }
51
51
  catch (syncError) {
52
52
  const errorMessage = syncError instanceof Error ? syncError.message : String(syncError);
53
- if (errorMessage.includes('AUTH_REQUIRED_OFFLINE_SESSION') || errorMessage.includes('offline')) {
53
+ if (errorMessage.includes('AUTH_REQUIRED_OFFLINE_SESSION') ||
54
+ errorMessage.includes('offline')) {
54
55
  throw new SessionSyncRequiredError();
55
56
  }
56
57
  throw syncError;
@@ -19,11 +19,13 @@ async function updateAvatarVisibility(fileId, oxyServices, contextName = 'Avatar
19
19
  }
20
20
  catch (visError) {
21
21
  // 404 is expected when asset doesn't exist yet — skip logging
22
- const status = (visError instanceof Error && 'status' in visError)
22
+ const status = visError instanceof Error && 'status' in visError
23
23
  ? visError.status
24
24
  : undefined;
25
25
  if (status !== 404) {
26
- logger_1.logger.error(`[${contextName}] Failed to update avatar visibility for ${fileId}`, visError, { component: contextName });
26
+ logger_1.logger.error(`[${contextName}] Failed to update avatar visibility for ${fileId}`, visError, {
27
+ component: contextName,
28
+ });
27
29
  }
28
30
  }
29
31
  }
@@ -240,7 +240,7 @@ function registerCacheForCleanup(cache) {
240
240
  }
241
241
  /** Empty registered caches need no timer; importing a client must stay inert. */
242
242
  function updateCleanupInterval() {
243
- const hasEntries = [...activeCaches].some(cache => cache.size() > 0);
243
+ const hasEntries = [...activeCaches].some((cache) => cache.size() > 0);
244
244
  if (!hasEntries) {
245
245
  if (cleanupInterval)
246
246
  clearInterval(cleanupInterval);
@@ -76,5 +76,7 @@ function computeIdentityTag(accessToken) {
76
76
  const decoded = (0, tokenClaims_1.decodeTokenClaims)(accessToken);
77
77
  // An undecodable token is still partitioned away from anon and from other
78
78
  // tokens via a hash — never silently ANON_IDENTITY.
79
- return decoded?.userId || decoded?.id || `t${fnv1a32(accessToken)}`;
79
+ return (decoded?.userId ||
80
+ decoded?.id ||
81
+ `t${fnv1a32(accessToken)}`);
80
82
  }
@@ -43,7 +43,7 @@ class DeviceManager {
43
43
  return {
44
44
  getItem: async (key) => localStorage.getItem(key),
45
45
  setItem: async (key, value) => localStorage.setItem(key, value),
46
- removeItem: async (key) => localStorage.removeItem(key)
46
+ removeItem: async (key) => localStorage.removeItem(key),
47
47
  };
48
48
  }
49
49
  }
@@ -62,7 +62,7 @@ class DeviceManager {
62
62
  fingerprint.screen = {
63
63
  width: screen.width,
64
64
  height: screen.height,
65
- colorDepth: screen.colorDepth
65
+ colorDepth: screen.colorDepth,
66
66
  };
67
67
  }
68
68
  return fingerprint;
@@ -97,7 +97,7 @@ class DeviceManager {
97
97
  deviceId: DeviceManager.generateDeviceId(),
98
98
  fingerprint: JSON.stringify(DeviceManager.getDeviceFingerprint()),
99
99
  createdAt: new Date().toISOString(),
100
- lastUsed: new Date().toISOString()
100
+ lastUsed: new Date().toISOString(),
101
101
  };
102
102
  await DeviceManager.saveDeviceInfo(deviceInfo);
103
103
  return deviceInfo;
@@ -146,7 +146,7 @@ class DeviceManager {
146
146
  if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
147
147
  const array = new Uint8Array(32);
148
148
  crypto.getRandomValues(array);
149
- return Array.from(array, byte => byte.toString(16).padStart(2, '0')).join('');
149
+ return Array.from(array, (byte) => byte.toString(16).padStart(2, '0')).join('');
150
150
  }
151
151
  throw new Error('No secure random source available for device ID generation');
152
152
  }
@@ -52,7 +52,7 @@ exports.ErrorCodes = {
52
52
  * nothing may retry it. See `retryAsync`'s default predicate, which refuses
53
53
  * this code specifically.
54
54
  */
55
- CANCELLED: 'CANCELLED'
55
+ CANCELLED: 'CANCELLED',
56
56
  };
57
57
  /**
58
58
  * Narrow a caught value to {@link HttpRequestError}.
@@ -119,7 +119,7 @@ function createApiError(message, code = exports.ErrorCodes.INTERNAL_ERROR, statu
119
119
  message,
120
120
  code,
121
121
  status,
122
- details
122
+ details,
123
123
  };
124
124
  }
125
125
  function createCancelledError(message = 'Request cancelled') {
@@ -180,7 +180,9 @@ function handleHttpError(error) {
180
180
  // Handle TypeError (network failures, CORS, etc.)
181
181
  if (error instanceof TypeError) {
182
182
  // Check if it's a network-related TypeError
183
- if (error.message.includes('fetch') || error.message.includes('network') || error.message.includes('Failed to fetch')) {
183
+ if (error.message.includes('fetch') ||
184
+ error.message.includes('network') ||
185
+ error.message.includes('Failed to fetch')) {
184
186
  return createApiError('Network error - failed to connect to server', exports.ErrorCodes.NETWORK_ERROR, 0);
185
187
  }
186
188
  return createApiError(error.message || 'Network error occurred', exports.ErrorCodes.NETWORK_ERROR, 0);
@@ -268,7 +270,7 @@ function extractErrorStatus(error) {
268
270
  * Validate required fields and throw error if missing
269
271
  */
270
272
  function validateRequiredFields(data, fields) {
271
- const missing = fields.filter(field => !data[field]);
273
+ const missing = fields.filter((field) => !data[field]);
272
274
  if (missing.length > 0) {
273
275
  throw createApiError(`Missing required fields: ${missing.join(', ')}`, exports.ErrorCodes.MISSING_PARAMETER, 400);
274
276
  }