@oxy.so/core 4.5.0-oxy-one.1 → 4.6.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 (283) 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 +39 -11
  7. package/dist/cjs/api/auth.js +28 -8
  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 +39 -11
  83. package/dist/esm/api/auth.js +28 -8
  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 +16 -3
  159. package/dist/types/api/apps.d.ts +4 -4
  160. package/dist/types/crypto/internal.d.ts +1 -1
  161. package/dist/types/index.d.ts +4 -4
  162. package/dist/types/models/interfaces.d.ts +9 -1
  163. package/dist/types/server/index.d.ts +6 -6
  164. package/dist/types/server/workloadIdentity.client.d.ts +5 -1
  165. package/dist/types/server/workloadIdentity.d.ts +26 -0
  166. package/dist/types/session/accountDelegationAccess.d.ts +1 -1
  167. package/dist/types/session/index.d.ts +1 -1
  168. package/dist/types/utils/userIdentity.d.ts +1 -1
  169. package/dist/types/utils/validationUtils.d.ts +4 -5
  170. package/package.json +3 -4
  171. package/src/HttpService.ts +183 -53
  172. package/src/OxyServices.errors.ts +7 -3
  173. package/src/OxyServices.ts +6 -2
  174. package/src/api/accounts.ts +96 -28
  175. package/src/api/agency.ts +24 -9
  176. package/src/api/appData.ts +12 -2
  177. package/src/api/apps.ts +81 -31
  178. package/src/api/assets.ts +113 -43
  179. package/src/api/auth.ts +145 -77
  180. package/src/api/billing.ts +112 -65
  181. package/src/api/civic.ts +61 -19
  182. package/src/api/contacts.ts +4 -1
  183. package/src/api/devices.ts +54 -21
  184. package/src/api/follows.ts +88 -31
  185. package/src/api/identity.ts +101 -33
  186. package/src/api/linkedAccounts.ts +26 -8
  187. package/src/api/nodes.ts +18 -6
  188. package/src/api/notifications.ts +26 -6
  189. package/src/api/privacy.ts +42 -8
  190. package/src/api/reputation.ts +18 -7
  191. package/src/api/session.ts +23 -5
  192. package/src/api/store.ts +81 -31
  193. package/src/api/topics.ts +18 -6
  194. package/src/api/users.ts +98 -35
  195. package/src/boot/sessionColdBoot.ts +60 -19
  196. package/src/civic/payloads.ts +1 -4
  197. package/src/client/context.ts +6 -1
  198. package/src/constants/version.ts +7 -6
  199. package/src/crypto/aead.ts +1 -5
  200. package/src/crypto/ecdh.ts +1 -4
  201. package/src/crypto/identityDerivations.ts +5 -1
  202. package/src/crypto/identityMarker.ts +3 -1
  203. package/src/crypto/identityProof.ts +6 -1
  204. package/src/crypto/index.ts +11 -11
  205. package/src/crypto/internal.ts +6 -1
  206. package/src/crypto/keyManager.ts +348 -98
  207. package/src/crypto/recoveryPhrase.ts +14 -9
  208. package/src/crypto/registrationPow.ts +1 -1
  209. package/src/crypto/signatureService.ts +14 -6
  210. package/src/i18n/accountCategoryLabels.ts +1 -4
  211. package/src/i18n/accountRoleLabels.ts +1 -4
  212. package/src/i18n/index.ts +25 -7
  213. package/src/i18n/locales/ar-SA.ts +375 -366
  214. package/src/i18n/locales/ca-ES.ts +382 -366
  215. package/src/i18n/locales/de-DE.ts +387 -366
  216. package/src/i18n/locales/en-US.ts +2034 -1994
  217. package/src/i18n/locales/es-ES.ts +2043 -1994
  218. package/src/i18n/locales/fr-FR.ts +387 -366
  219. package/src/i18n/locales/it-IT.ts +380 -366
  220. package/src/i18n/locales/ja-JP.ts +380 -366
  221. package/src/i18n/locales/ko-KR.ts +377 -366
  222. package/src/i18n/locales/pt-PT.ts +383 -366
  223. package/src/i18n/locales/zh-CN.ts +373 -366
  224. package/src/i18n/trustTierLabels.ts +1 -4
  225. package/src/index.ts +371 -349
  226. package/src/inference/OxyInferenceClient.ts +784 -780
  227. package/src/models/interfaces.ts +39 -27
  228. package/src/server/OxyServer.ts +227 -68
  229. package/src/server/agentAccount.ts +8 -2
  230. package/src/server/aliaMachineCredential.ts +57 -16
  231. package/src/server/auth.ts +9 -5
  232. package/src/server/capabilityTicket.ts +30 -21
  233. package/src/server/index.ts +29 -6
  234. package/src/server/liveCapabilityTicket.ts +31 -9
  235. package/src/server/middleware.ts +212 -121
  236. package/src/server/namespaces.ts +247 -94
  237. package/src/server/rateLimit.ts +2 -4
  238. package/src/server/requesterAssertion.ts +93 -54
  239. package/src/server/serviceTokenLifetime.ts +9 -4
  240. package/src/server/traffic.ts +117 -23
  241. package/src/server/trafficNodeHttp.ts +61 -14
  242. package/src/server/userInvalidation.ts +1 -4
  243. package/src/server/workloadIdentity.client.ts +12 -1
  244. package/src/server/workloadIdentity.ts +52 -5
  245. package/src/session/SessionClient.ts +170 -49
  246. package/src/session/accountDelegationAccess.ts +24 -31
  247. package/src/session/accountDialogController.ts +59 -14
  248. package/src/session/accountSwitchTargets.ts +10 -15
  249. package/src/session/authStateStore.ts +121 -81
  250. package/src/session/deviceDirectory.ts +1 -3
  251. package/src/session/identityPin.ts +10 -11
  252. package/src/session/identitySession.ts +3 -1
  253. package/src/session/index.ts +87 -82
  254. package/src/session/refresh.ts +138 -44
  255. package/src/session/sessionClientHost.ts +1 -3
  256. package/src/session/sharedDeviceCredential.ts +35 -14
  257. package/src/session/socketLoader.ts +9 -2
  258. package/src/shared/utils/errorUtils.ts +5 -2
  259. package/src/shared/utils/networkUtils.ts +5 -8
  260. package/src/shared/utils/themeUtils.ts +2 -6
  261. package/src/types/buffer.d.ts +66 -21
  262. package/src/types/expo-secure-store.d.ts +5 -1
  263. package/src/utils/accountCacheSweep.ts +4 -5
  264. package/src/utils/accountUtils.ts +107 -108
  265. package/src/utils/apiUtils.ts +3 -3
  266. package/src/utils/asyncUtils.ts +2 -2
  267. package/src/utils/authHelpers.ts +10 -5
  268. package/src/utils/avatarUtils.ts +11 -6
  269. package/src/utils/cache.ts +9 -10
  270. package/src/utils/cacheKey.ts +5 -1
  271. package/src/utils/coldBoot.ts +1 -3
  272. package/src/utils/commonsDelivery.ts +1 -4
  273. package/src/utils/deviceManager.ts +15 -14
  274. package/src/utils/errorUtils.ts +68 -86
  275. package/src/utils/languageUtils.ts +407 -58
  276. package/src/utils/oauthPkce.ts +1 -4
  277. package/src/utils/platform.ts +0 -1
  278. package/src/utils/profileLinks.ts +2 -5
  279. package/src/utils/requestUtils.ts +18 -14
  280. package/src/utils/sessionUtils.ts +34 -33
  281. package/src/utils/userHandle.ts +3 -1
  282. package/src/utils/userIdentity.ts +1 -1
  283. package/src/utils/validationUtils.ts +11 -9
@@ -24,13 +24,13 @@ export { OxyServices, OXY_API_URL, OXY_CLOUD_URL } from './OxyServices';
24
24
  export type { OxyConfig, LinkedHttpClient } from './OxyServices';
25
25
  export { OxyApiError, OxyAuthenticationError, OxyAuthenticationTimeoutError, AssetUrlResolutionError, ServiceAssetMetadataError, } from './OxyServices.errors';
26
26
  export type { HttpMethod } from './client/context';
27
- export type { RequestOptions, ResponseRequest, ResponseTransport, AuthenticatedResponseRequest, AuthRefreshReason, AuthRefreshHandler } from './HttpService';
27
+ export type { RequestOptions, ResponseRequest, ResponseTransport, AuthenticatedResponseRequest, AuthRefreshReason, AuthRefreshHandler, } from './HttpService';
28
28
  export type { SessionApi, DeviceCredentialProvider, SessionValidation } from './api/session';
29
29
  export type { AuthApi, ChallengeResponse, RegistrationRequest, ChallengeVerifyRequest, PublicKeyCheckResponse, OAuthUserInfoResponse, OAuthTokenExchangeResult, CommonsSignInHandle, CommonsSignInStatus, CommonsSignInPurpose, CommonsOAuthContext, CommonsApprovalInfo, CommonsApprovalSubjectAccount, CommonsSignInActionResult, CommonsOAuthFinalizeResult, CommonsDeliveryResult, SignInDeviceOptions, ClaimedSession, } from './api/auth';
30
30
  export type { UsersApi, ResolveExternalUserInput, DeleteAccountProof } from './api/users';
31
31
  export type { FollowsApi, FollowMutationResult, BulkFollowEntry, BulkFollowResult, BulkUnfollowEntry, BulkUnfollowResult, ViewerGraph, EnsureFollowTargetInput, RegisterFollowKindInput, } from './api/follows';
32
32
  export type { PrivacyApi } from './api/privacy';
33
- export type { NotificationsApi, PushTokenPlatform, RegisterPushTokenInput } from './api/notifications';
33
+ export type { NotificationsApi, PushTokenPlatform, RegisterPushTokenInput, } from './api/notifications';
34
34
  export { assetUrlCacheTTL } from './api/assets';
35
35
  export type { AssetsApi, AssetRecord, UploadedAsset, AssetLinkState, AssetUploadOptions, AssetLinkTarget, AssetDeleteResult, } from './api/assets';
36
36
  export { buildUserDid } from './api/identity';
@@ -45,7 +45,7 @@ export type { BillingApi, SubscriptionPlan, SubscriptionStatus, SubscriptionFeat
45
45
  export { REPUTATION_CACHE_PREFIX } from './api/reputation';
46
46
  export type { ReputationApi, ReputationPage } from './api/reputation';
47
47
  export type { CivicApi, CivicCardResult, SubmitRealLifeAttestationInput, DenyValidationResult, VouchForPersonInput, WithdrawVouchResult, IssueCredentialInput, RevokeCredentialResult, } from './api/civic';
48
- export type { NodesApi, UserNodeStatus, UserNodeMode, UserNodeController, UserNodeLivenessStatus, RegisterNodeInput, RemoveNodeResult } from './api/nodes';
48
+ export type { NodesApi, UserNodeStatus, UserNodeMode, UserNodeController, UserNodeLivenessStatus, RegisterNodeInput, RemoveNodeResult, } from './api/nodes';
49
49
  export { AccountNotOnDeviceError } from './api/devices';
50
50
  export type { DevicesApi, UserDevice, SecurityInfo } from './api/devices';
51
51
  export type { TopicsApi, TopicListOptions } from './api/topics';
@@ -53,7 +53,7 @@ export { OxyAppDataIdentifierError } from './api/appData';
53
53
  export type { AppDataApi } from './api/appData';
54
54
  export type { ContactsApi, ContactDiscoveryMatch, ContactDiscoveryResponse } from './api/contacts';
55
55
  export { getCommonsApprovalBlockingReason, parseCommonsApprovalExpiresAt, } from './utils/commonsApproval';
56
- export { selectCommonsDelivery, pushTargetsFromDelivery, commonsDeliveryPlatform } from './utils/commonsDelivery';
56
+ export { selectCommonsDelivery, pushTargetsFromDelivery, commonsDeliveryPlatform, } from './utils/commonsDelivery';
57
57
  export type { CommonsDeliveryFacts, CommonsDeliveryPlatform, CommonsDeliveryRoute, } from './utils/commonsDelivery';
58
58
  export { getNormalizedUserId, normalizeUserIdentity, normalizeUserIdentityOrNull, } from './utils/userIdentity';
59
59
  export { getCanonicalUserHandle, getNormalizedUserHandle, } from './utils/userHandle';
@@ -1,4 +1,4 @@
1
- import type { AccountKind, AccountCategoryId, UserNameResponse, UserRelationship, ThemePreference, OxyNotificationEntityType, OxyNotificationType } from '@oxy.so/contracts';
1
+ import type { AccountKind, AccountCategoryId, AvatarCharacter, UserNameResponse, UserRelationship, ThemePreference, OxyNotificationEntityType, OxyNotificationType } from '@oxy.so/contracts';
2
2
  export interface OxyConfig {
3
3
  baseURL: string;
4
4
  cloudURL?: string;
@@ -160,7 +160,15 @@ export interface User {
160
160
  isFederated?: boolean;
161
161
  /** Allow sharing this user's content on the fediverse. Defaults to true. */
162
162
  fediverseSharing?: boolean;
163
+ /**
164
+ * Derived from `kind === 'bot'` (the SOLE definition), NOT from `type`.
165
+ */
163
166
  isAgent?: boolean;
167
+ /**
168
+ * The 3D avatar character of a `kind: 'bot'` account, drawn by Bloom's
169
+ * `Avatar`. Present ONLY on a bot; absent for every other kind.
170
+ */
171
+ character?: AvatarCharacter;
164
172
  isAutomated?: boolean;
165
173
  instance?: string;
166
174
  federation?: {
@@ -14,7 +14,7 @@
14
14
  * app.use('/api', createOxyAuthMiddleware(oxy));
15
15
  * ```
16
16
  */
17
- export { OxyServer, ServiceCredentialMismatchError, ANONYMOUS_SERVICE_TOKEN_RETRY_MS } from './OxyServer';
17
+ export { OxyServer, ServiceCredentialMismatchError, ANONYMOUS_SERVICE_TOKEN_RETRY_MS, } from './OxyServer';
18
18
  export type { OxyServerConfig, ServiceTokenResponse } from './OxyServer';
19
19
  export { ServerAppsApi, ServerAgencyApi, ServerAssetsApi, ServerLinkedAccountsApi, ServerNotificationsApi, ServerReputationApi, } from './namespaces';
20
20
  export { createOxyAliaMachineCredentialAuth, getOxyAliaMachineCredentialBearer, isOxyAliaMachinePrincipal, OXY_ALIA_RESOURCE_APPLICATION_ID, OXY_ALIA_MACHINE_SCOPES, } from './aliaMachineCredential';
@@ -42,10 +42,10 @@ export { createLiveCapabilityTicketVerifier } from './liveCapabilityTicket';
42
42
  export type { LiveCapabilityTicketVerifierOptions } from './liveCapabilityTicket';
43
43
  export { createOxyUserInvalidationHandler, publishOxyUserInvalidation, } from './userInvalidation';
44
44
  export type { OxyInvalidationPublisher, OxyUserInvalidationHandlerOptions, } from './userInvalidation';
45
- export { evictOxyIdentityCache, oxyUserByIdCacheKey, OXY_IDENTITY_CACHE_PREFIXES } from '../utils/identityCacheSweep';
45
+ export { evictOxyIdentityCache, oxyUserByIdCacheKey, OXY_IDENTITY_CACHE_PREFIXES, } from '../utils/identityCacheSweep';
46
46
  export type { OxyIdentityCacheEvictor } from '../utils/identityCacheSweep';
47
47
  export { registrableApex } from '../utils/registrableApex';
48
- export { isLoopbackOrigin, isOfficialWebOrigin, isAllowedDeviceJoinOrigin } from '../utils/officialOrigins';
48
+ export { isLoopbackOrigin, isOfficialWebOrigin, isAllowedDeviceJoinOrigin, } from '../utils/officialOrigins';
49
49
  export { createEcosystemTraffic } from './traffic';
50
50
  export type { EcosystemTrafficOptions } from './traffic';
51
51
  export { observeNodeHttp, withoutNodeHttpObservation } from './trafficNodeHttp';
@@ -55,8 +55,8 @@ export { observeNodeHttp, withoutNodeHttpObservation } from './trafficNodeHttp';
55
55
  * exported from this subpath rather than the root barrel because it reaches the
56
56
  * container credentials endpoint.
57
57
  */
58
- export { canAttestWorkloadIdentity, requestWorkloadServiceToken } from './workloadIdentity';
59
- export type { WorkloadServiceToken, WorkloadServiceTokenOptions } from './workloadIdentity';
60
- export { OXY_SERVICE_TOKEN_MAX_LIFETIME_SECONDS, hasBoundedServiceTokenLifetime } from './serviceTokenLifetime';
58
+ export { attestWorkloadIdentity, canAttestWorkloadIdentity, requestWorkloadServiceToken, } from './workloadIdentity';
59
+ export type { WorkloadAttestation, WorkloadServiceToken, WorkloadServiceTokenOptions, } from './workloadIdentity';
60
+ export { OXY_SERVICE_TOKEN_MAX_LIFETIME_SECONDS, hasBoundedServiceTokenLifetime, } from './serviceTokenLifetime';
61
61
  export { signInAgentAccount } from './agentAccount';
62
62
  export type { AgentAccountSigner } from './agentAccount';
@@ -1,4 +1,8 @@
1
- import type { WorkloadServiceToken, WorkloadServiceTokenOptions } from './workloadIdentity';
1
+ import type { WorkloadAttestation, WorkloadServiceToken, WorkloadServiceTokenOptions } from './workloadIdentity';
2
2
  /** Workload attestation belongs to a Node host, never a browser or device. */
3
3
  export declare function canAttestWorkloadIdentity(): boolean;
4
4
  export declare function requestWorkloadServiceToken(_options: WorkloadServiceTokenOptions): Promise<WorkloadServiceToken>;
5
+ export declare function attestWorkloadIdentity(_options: {
6
+ nonce: string;
7
+ fetch?: typeof fetch;
8
+ }): Promise<WorkloadAttestation>;
@@ -18,6 +18,32 @@ export interface WorkloadServiceToken {
18
18
  * checkout has no attestation to offer and must fall back to a credential.
19
19
  */
20
20
  export declare function canAttestWorkloadIdentity(env?: NodeJS.ProcessEnv): boolean;
21
+ /** A proof of this process's identity, exactly as `POST /auth/service-token/workload` takes it. */
22
+ export interface WorkloadAttestation {
23
+ provider: 'aws-iam';
24
+ attestation: {
25
+ headers: Record<string, string>;
26
+ };
27
+ }
28
+ /**
29
+ * Signs this process's identity proof over a nonce the CALLER chose, and sends
30
+ * it nowhere.
31
+ *
32
+ * {@link requestWorkloadServiceToken} is the ordinary consumer: Oxy issues the
33
+ * nonce and replays the proof. This exists for the one host that is its own
34
+ * verifier — Oxy's API acting as an application it hosts (Inbox) needs to learn
35
+ * which role it runs as, and the honest way to learn that is the way it learns
36
+ * anyone else's: sign `GetCallerIdentity` and let STS say whose signature it is.
37
+ * Reading a role name out of configuration would be the process's own word for
38
+ * what it is, which is what ADR 0026 refuses from every other caller.
39
+ *
40
+ * The same signer, so the two can never disagree about the shape the verifier
41
+ * accepts. Throws exactly as the token path does when there is no identity here.
42
+ */
43
+ export declare function attestWorkloadIdentity(options: {
44
+ nonce: string;
45
+ fetch?: typeof fetch;
46
+ }): Promise<WorkloadAttestation>;
21
47
  /**
22
48
  * Exchanges this process's identity for an Oxy service token.
23
49
  *
@@ -13,7 +13,7 @@
13
13
  * (or the structural subset below), so the SDK and every agent runtime read the
14
14
  * API's already-resolved relationship and effective permissions identically.
15
15
  */
16
- import type { AccountKind, AccountMember, AccountRelationship } from "../api/accounts";
16
+ import type { AccountKind, AccountMember, AccountRelationship } from '../api/accounts';
17
17
  export interface AccountDelegationAccess {
18
18
  /** The caller owns the account or has a live membership in it. */
19
19
  readonly hasStanding: boolean;
@@ -10,7 +10,7 @@ import '../crypto/polyfill';
10
10
  export { DeviceManager } from '../utils/deviceManager';
11
11
  export type { DeviceFingerprint, StoredDeviceInfo } from '../utils/deviceManager';
12
12
  export { SessionClient } from './SessionClient';
13
- export type { TokenTransport, SessionClientHost, SessionClientOptions, DeviceCredential, SessionStateOrigin } from './SessionClient';
13
+ export type { TokenTransport, SessionClientHost, SessionClientOptions, DeviceCredential, SessionStateOrigin, } from './SessionClient';
14
14
  export type { SocketIOFactory, MinimalSocket } from './socketLoader';
15
15
  export { createSessionClientHost } from './sessionClientHost';
16
16
  export { createSessionClient } from './createSessionClient';
@@ -4,7 +4,7 @@ interface UserIdentityInput {
4
4
  }
5
5
  /**
6
6
  * Returns the stable SDK user id from API payloads that may use either `id` or
7
- * Mongo-style `_id`.
7
+ * a raw `_id`.
8
8
  */
9
9
  export declare function getNormalizedUserId(user: UserIdentityInput | null | undefined): string | null;
10
10
  /**
@@ -65,10 +65,10 @@ export declare function isValidPassword(password: string): boolean;
65
65
  * — script digits (`٠١٢`, `०१२`), 1082 symbols (`֍ ۞ ৳`), 180 punctuation marks
66
66
  * (`։ ، ؛ ।`), and 9 INVISIBLE format/control characters, among them U+061C
67
67
  * ARABIC LETTER MARK (a bidi control that can visually reorder a name) and
68
- * U+180E MONGOLIAN VOWEL SEPARATOR. Without it the rejections listed above held
68
+ * U+180E (the Mong-script vowel separator). Without it the rejections listed above held
69
69
  * for ASCII input only. It is the set of scripts Unicode UTS #39 marks
70
70
  * "Recommended" for general interchange / identifiers, plus Cherokee and
71
- * Mongolian (both in real modern name use). "Common" script is deliberately
71
+ * the Mong script, ISO 15924 (both in real modern name use). "Common" script is deliberately
72
72
  * EXCLUDED — that is where ASCII digits and general punctuation live, and this
73
73
  * policy excludes those; the space separators, combining marks, and apostrophe a
74
74
  * name needs are added back explicitly. Limited-use / excluded / historic
@@ -257,9 +257,8 @@ export declare function sanitizeString(input: string): string;
257
257
  */
258
258
  export declare function sanitizeHTML(input: string): string;
259
259
  /**
260
- * Validate MongoDB ObjectId format
261
- * Note: This is a basic format check. For full validation, use mongoose.Types.ObjectId.isValid()
262
- * This function works in environments where mongoose may not be available (e.g., client-side)
260
+ * Validate the legacy 24-hex id format (a format check only; it does not
261
+ * prove the id exists).
263
262
  */
264
263
  export declare function isValidObjectId(id: string): boolean;
265
264
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/core",
3
- "version": "4.5.0-oxy-one.1",
3
+ "version": "4.6.0",
4
4
  "description": "OxyHQ SDK Foundation — API client, authentication, cryptographic identity, and shared utilities",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -179,7 +179,7 @@
179
179
  "@oxy.so/telemetry": "^1.2.0",
180
180
  "@noble/ciphers": "^1.3.0",
181
181
  "@noble/hashes": "^1.8.0",
182
- "@oxy.so/contracts": "4.11.0-oxy-one.0",
182
+ "@oxy.so/contracts": "4.13.0",
183
183
  "@oxy.so/protocol": "^1.2.2",
184
184
  "@scure/bip39": "^1.6.0",
185
185
  "buffer": "^6.0.3",
@@ -212,13 +212,12 @@
212
212
  }
213
213
  },
214
214
  "devDependencies": {
215
- "@biomejs/biome": "^1.9.4",
216
215
  "@react-native-async-storage/async-storage": "^2.2.0",
217
216
  "@types/express": "^4.17.25",
218
217
  "@types/invariant": "^2.2.34",
219
218
  "@types/node": "^20.19.43",
220
219
  "expo-crypto": "~56.0.3",
221
- "expo-secure-store": "~56.0.4",
220
+ "expo-secure-store": "~57.0.4",
222
221
  "express": "^4.22.2",
223
222
  "express-rate-limit": "^8.6.0",
224
223
  "jest": "^30.5.1",