@seams/wallet-server 0.7.1 → 0.7.3

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 (259) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -105
  2. package/artifact-manifest.json +21 -21
  3. package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
  4. package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
  5. package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
  6. package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
  7. package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
  8. package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
  9. package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
  10. package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
  11. package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
  12. package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
  13. package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
  14. package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
  15. package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
  16. package/dist/esm/authorization/service.js +8 -0
  17. package/dist/esm/authorization/vaultProxyUse.js +2 -6
  18. package/dist/esm/cloud-host.js +4 -4
  19. package/dist/esm/core/IdentityStore.js +23 -110
  20. package/dist/esm/core/SessionService.js +7 -30
  21. package/dist/esm/core/ThresholdService/routerAbNormalSigningPolicy.js +3 -10
  22. package/dist/esm/core/ThresholdService/stores/WalletSessionStore.js +21 -97
  23. package/dist/esm/core/ThresholdService/stores/exportReplayGuard.js +7 -0
  24. package/dist/esm/core/WalletStore.js +4 -6
  25. package/dist/esm/core/authService/bytes.js +1 -4
  26. package/dist/esm/core/authService/emailOtpChallengeOperations.js +2 -5
  27. package/dist/esm/core/authService/emailOtpChallengeProof.js +9 -40
  28. package/dist/esm/core/authService/emailOtpChallengeVerification.js +19 -90
  29. package/dist/esm/core/authService/emailOtpChallenges.js +10 -45
  30. package/dist/esm/core/authService/emailOtpDelivery.js +10 -45
  31. package/dist/esm/core/authService/emailOtpEnrollment.js +9 -40
  32. package/dist/esm/core/authService/emailOtpGrant.js +9 -40
  33. package/dist/esm/core/authService/emailOtpRegistrationEnrollment.js +9 -40
  34. package/dist/esm/core/authService/emailOtpSeal.js +5 -20
  35. package/dist/esm/core/authService/emailOtpUnlock.js +20 -110
  36. package/dist/esm/core/authService/googleEmailOtpRegistration.js +28 -115
  37. package/dist/esm/core/authService/identity.js +5 -20
  38. package/dist/esm/core/authService/nearPublicKeyMetadata.js +6 -25
  39. package/dist/esm/core/authService/oidcVerification.js +22 -34
  40. package/dist/esm/core/authService/rateLimits.js +2 -5
  41. package/dist/esm/core/authService/thresholdEcdsaKeyInventory.js +2 -1
  42. package/dist/esm/core/authService/webauthn.js +37 -191
  43. package/dist/esm/core/authService/webauthnVerificationOutcomes.js +5 -24
  44. package/dist/esm/core/d1EcdsaSignerRead.js +76 -0
  45. package/dist/esm/core/d1IdentityStore.js +16 -75
  46. package/dist/esm/core/d1TenantStore.js +1 -1
  47. package/dist/esm/core/d1WalletStore.js +15 -25
  48. package/dist/esm/core/deviceLinking/linkedDeviceEmailOtpGrant.js +1 -5
  49. package/dist/esm/core/deviceLinking/linkedDeviceSessionApproval.js +1 -3
  50. package/dist/esm/core/deviceLinking/linkedDeviceSessionRecord.js +2 -8
  51. package/dist/esm/core/deviceLinking/requestProof.js +13 -4
  52. package/dist/esm/core/ecdsaMaterialReadSnapshot.js +85 -0
  53. package/dist/esm/core/nearRelayerAccountProvisioning.js +2 -5
  54. package/dist/esm/core/signingLanes/WalletExecutionLaneProjection.js +3 -6
  55. package/dist/esm/core/signingMaterial/ordinaryInactiveSignerMaterialReservation.js +2 -5
  56. package/dist/esm/core/storeBackends.js +1 -1
  57. package/dist/esm/core/thresholdEcdsaChainTarget.js +1 -3
  58. package/dist/esm/hosted-wallet-gateway.js +2 -2
  59. package/dist/esm/localHostedWalletGatewayHandler.js +13 -0
  60. package/dist/esm/localIntendedMaterialAdmissionFault.js +176 -0
  61. package/dist/esm/localIntendedPresignCancellation.js +44 -0
  62. package/dist/esm/router/auth/commonRouterUtils.js +24 -10
  63. package/dist/esm/router/auth/walletSessionFailure.js +2 -5
  64. package/dist/esm/router/auth/webAuthnCredentialCodecs.js +4 -15
  65. package/dist/esm/router/cloudflare/d1/auth/d1AuthorizedOperationRouteService.js +1 -0
  66. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthBoundary.js +2 -6
  67. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +5 -27
  68. package/dist/esm/router/cloudflare/d1/auth/walletSessionCredentialReaders.js +76 -0
  69. package/dist/esm/router/cloudflare/d1/authorization/authorizedOperationStatements.js +28 -21
  70. package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +209 -44
  71. package/dist/esm/router/cloudflare/d1/authorization/d1VaultProxyStore.js +8 -12
  72. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +50 -8
  73. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +1 -1
  74. package/dist/esm/router/cloudflare/d1/deviceLinking/index.js +3 -3
  75. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +12 -55
  76. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.js +17 -80
  77. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpDeliveryRuntime.js +6 -25
  78. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +12 -47
  79. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +24 -85
  80. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer.js +7 -30
  81. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.js +5 -20
  82. package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +23 -110
  83. package/dist/esm/router/cloudflare/d1/identity/d1IdentityService.js +9 -40
  84. package/dist/esm/router/cloudflare/d1/near/d1NearPublicKeyStore.js +3 -10
  85. package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +18 -91
  86. package/dist/esm/router/cloudflare/d1/oidc/d1OidcVerificationService.js +6 -30
  87. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyRouteService.js +4 -15
  88. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +2 -7
  89. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpRecords.js +9 -13
  90. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpService.js +11 -50
  91. package/dist/esm/router/cloudflare/d1/registration/d1EvmFamilyEcdsaRegistrationBranch.js +5 -20
  92. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +4 -7
  93. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +2 -1
  94. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationIntentService.js +7 -30
  95. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +32 -22
  96. package/dist/esm/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.js +1 -4
  97. package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +119 -25
  98. package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +31 -168
  99. package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnRecords.js +6 -9
  100. package/dist/esm/router/cloudflare/durableObjects/thresholdStore.js +59 -66
  101. package/dist/esm/router/cloudflare/runtime/routerAbPrewarm.js +2 -2
  102. package/dist/esm/router/cloudflare/runtime/staticWalletConsoleBinding.js +5 -20
  103. package/dist/esm/router/cloudflare/runtime/tenantRootCreationGrant.js +2 -9
  104. package/dist/esm/router/cloudflare/runtime/walletControlOps.js +2 -1
  105. package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneCurveExecution.js +2 -1
  106. package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneProtocolCommitter.js +2 -2
  107. package/dist/esm/router/cloudflare.js +2146 -1802
  108. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPersistence.js +5 -8
  109. package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js +3 -6
  110. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.js +6 -25
  111. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationSideEffectBoundary.js +39 -55
  112. package/dist/esm/router/domains/emailOtp/emailOtpRouteHandlers.js +15 -62
  113. package/dist/esm/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.js +83 -74
  114. package/dist/esm/router/domains/signingOperations/routerAbNormalSigningAdmission.js +1 -0
  115. package/dist/esm/router/domains/signingOperations/routerAbOperationStepUp.js +1 -0
  116. package/dist/esm/router/domains/signingOperations/walletExecutionAdmission.js +1 -4
  117. package/dist/esm/router/domains/tenantRoot/tenantRootIdentityResolution.js +7 -13
  118. package/dist/esm/router/domains/walletUnlock/walletUnlockRouteHandlers.js +41 -200
  119. package/dist/esm/router/express.js +317 -699
  120. package/dist/esm/router/framework/http.js +5 -1
  121. package/dist/esm/router/framework/runtimeSnapshotConsumer.js +8 -35
  122. package/dist/esm/router/transport/fetch/createFetchRouter.js +3 -6
  123. package/dist/esm/router/transport/fetch/routes/auth.js +9 -41
  124. package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +5 -22
  125. package/dist/esm/router/transport/fetch/routes/nearPublicKeys.js +4 -16
  126. package/dist/esm/router/transport/fetch/routes/sessions.js +1 -0
  127. package/dist/esm/router/transport/fetch/routes/syncAccount.js +8 -36
  128. package/dist/esm/router/transport/fetch/routes/thresholdEcdsa.js +27 -79
  129. package/dist/esm/router/transport/fetch/routes/walletExecutionLanePreflight.js +4 -1
  130. package/dist/esm/router/transport/fetch/routes/webauthnAuthenticators.js +4 -16
  131. package/dist/esm/shared-ts/src/authorization/walletSignerActivationEquality.js +12 -0
  132. package/dist/esm/shared-ts/src/device-linking/committedSignerPackages.js +2 -5
  133. package/dist/esm/shared-ts/src/device-linking/delegatedActivationPlan.js +1 -5
  134. package/dist/esm/shared-ts/src/device-linking/ed25519ExportRoot.js +12 -16
  135. package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +5 -8
  136. package/dist/esm/shared-ts/src/passkey-custody/primitives.js +5 -1
  137. package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +4 -8
  138. package/dist/esm/shared-ts/src/tenant-root/tenantRootIdentifier.js +12 -0
  139. package/dist/esm/shared-ts/src/tenant-root/tenantRootIdentity.js +2 -9
  140. package/dist/esm/shared-ts/src/tenant-root/tenantRootOperationRecord.js +1 -4
  141. package/dist/esm/shared-ts/src/utils/ecdsaKeyFactsInventory.js +2 -4
  142. package/dist/esm/shared-ts/src/utils/ecdsaServerTiming.js +0 -1
  143. package/dist/esm/shared-ts/src/utils/emailOtpDomain.js +3 -1
  144. package/dist/esm/shared-ts/src/utils/exactKeys.js +17 -0
  145. package/dist/esm/shared-ts/src/utils/failure.js +20 -0
  146. package/dist/esm/shared-ts/src/utils/registrationIntent.js +3 -12
  147. package/dist/esm/shared-ts/src/utils/registrationSignerPlan.js +2 -5
  148. package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -1
  149. package/dist/esm/shared-ts/src/utils/routerAbEd25519Yao.js +1 -1
  150. package/dist/esm/shared-ts/src/utils/thresholdEcdsaChainTarget.js +9 -0
  151. package/dist/esm/shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.js +1 -4
  152. package/dist/esm/threshold/session/signingSessionSeal/crypto/cipher.js +10 -32
  153. package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +3 -3
  154. package/dist/esm/threshold/session/signingSessionSeal/idempotencyRecords.js +3 -9
  155. package/dist/esm/threshold/session/signingSessionSeal/service.js +8 -35
  156. package/dist/esm/threshold/session/signingSessionSeal/transport/express.js +18 -94
  157. package/dist/esm/threshold/session/signingSessionSeal/transport/fetch.js +6 -30
  158. package/dist/esm/threshold/session/signingSessionSeal/transport/shared.js +5 -20
  159. package/dist/esm/wasm/evm_crypto/pkg/evm_crypto_bg.wasm +0 -0
  160. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  161. package/dist/types/shared-ts/src/authorization/delegatedAuthority.d.ts +2 -1
  162. package/dist/types/shared-ts/src/authorization/walletSessionIssuance.d.ts +9 -2
  163. package/dist/types/shared-ts/src/authorization/walletSignerActivationEquality.d.ts +4 -0
  164. package/dist/types/shared-ts/src/device-linking/committedSignerPackages.d.ts +3 -4
  165. package/dist/types/shared-ts/src/device-linking/contracts.d.ts +5 -63
  166. package/dist/types/shared-ts/src/device-linking/sourceContribution.d.ts +2 -0
  167. package/dist/types/shared-ts/src/passkey-custody/custodyEnvelope.d.ts +5 -12
  168. package/dist/types/shared-ts/src/passkey-custody/primitives.d.ts +9 -0
  169. package/dist/types/shared-ts/src/signing-lanes/execution.d.ts +11 -1
  170. package/dist/types/shared-ts/src/signing-lanes/ids.d.ts +1 -10
  171. package/dist/types/shared-ts/src/signing-lanes/rotation.d.ts +3 -5
  172. package/dist/types/shared-ts/src/tenant-root/tenantRootIdentifier.d.ts +3 -0
  173. package/dist/types/shared-ts/src/tenant-root/tenantRootOperationRecord.d.ts +2 -1
  174. package/dist/types/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.d.ts +6 -0
  175. package/dist/types/shared-ts/src/threshold/signingRootScope.d.ts +1 -0
  176. package/dist/types/shared-ts/src/utils/ecdsaKeyFactsInventory.d.ts +2 -11
  177. package/dist/types/shared-ts/src/utils/eip1559TxWasmJson.d.ts +16 -0
  178. package/dist/types/shared-ts/src/utils/emailOtpDomain.d.ts +2 -0
  179. package/dist/types/shared-ts/src/utils/exactKeys.d.ts +11 -0
  180. package/dist/types/shared-ts/src/utils/failure.d.ts +12 -0
  181. package/dist/types/shared-ts/src/utils/jsonRpc.d.ts +3 -4
  182. package/dist/types/shared-ts/src/utils/nearRpcResults.d.ts +1 -0
  183. package/dist/types/shared-ts/src/utils/registrationAuthMethodInput.d.ts +3 -8
  184. package/dist/types/shared-ts/src/utils/registrationSignerPlan.d.ts +7 -19
  185. package/dist/types/shared-ts/src/utils/routerAbEcdsaDerivation.d.ts +3 -1
  186. package/dist/types/shared-ts/src/utils/routerAbEd25519Yao.d.ts +1 -0
  187. package/dist/types/shared-ts/src/utils/routerAbEd25519YaoDigests.d.ts +3 -4
  188. package/dist/types/shared-ts/src/utils/routerAbNormalSigningIdentity.d.ts +30 -8
  189. package/dist/types/shared-ts/src/utils/routerApiKeyAuth.d.ts +2 -0
  190. package/dist/types/shared-ts/src/utils/signingSessionSeal.d.ts +10 -11
  191. package/dist/types/shared-ts/src/utils/thresholdEcdsaChainTarget.d.ts +25 -0
  192. package/dist/types/shared-ts/src/utils/variant.d.ts +18 -0
  193. package/dist/types/shared-ts/src/utils/walletAuthMethodRecord.d.ts +3 -6
  194. package/dist/types/shared-ts/src/utils/webauthnDeviceInfo.d.ts +4 -2
  195. package/dist/types/shared-ts/src/wallet-recovery/recoveryEnvelopes.d.ts +3 -16
  196. package/dist/types/shared-ts/src/wallet-recovery/walletRecoveryPreparation.d.ts +15 -0
  197. package/dist/types/shared-ts/src/wallet-recovery/walletRecoveryTarget.d.ts +3 -4
  198. package/dist/types/wallet-server/src/authorization/domain.d.ts +13 -2
  199. package/dist/types/wallet-server/src/authorization/ecdsaWalletSessionAdmission.d.ts +27 -3
  200. package/dist/types/wallet-server/src/authorization/service.d.ts +19 -0
  201. package/dist/types/wallet-server/src/core/ThresholdService/stores/SessionStore.d.ts +2 -2
  202. package/dist/types/wallet-server/src/core/ThresholdService/stores/WalletSessionStore.d.ts +1 -1
  203. package/dist/types/wallet-server/src/core/ThresholdService/stores/exportReplayGuard.d.ts +3 -0
  204. package/dist/types/wallet-server/src/core/ThresholdService/validation.d.ts +8 -101
  205. package/dist/types/wallet-server/src/core/WebAuthnAuthenticatorStore.d.ts +8 -0
  206. package/dist/types/wallet-server/src/core/authService/bytes.d.ts +0 -1
  207. package/dist/types/wallet-server/src/core/authService/emailOtpChallenges.d.ts +2 -10
  208. package/dist/types/wallet-server/src/core/authService/emailOtpSeal.d.ts +1 -1
  209. package/dist/types/wallet-server/src/core/authService/emailOtpUnlock.d.ts +3 -10
  210. package/dist/types/wallet-server/src/core/d1EcdsaSignerRead.d.ts +39 -0
  211. package/dist/types/wallet-server/src/core/d1WalletStore.d.ts +10 -0
  212. package/dist/types/wallet-server/src/core/deviceLinking/linkedDeviceSessionRecord.d.ts +3 -4
  213. package/dist/types/wallet-server/src/core/ecdsaMaterialReadSnapshot.d.ts +19 -0
  214. package/dist/types/wallet-server/src/core/routerAbSigning/RouterAbNormalSigningRuntime.d.ts +3 -5
  215. package/dist/types/wallet-server/src/core/rpcClients/near/NearClient.d.ts +1 -2
  216. package/dist/types/wallet-server/src/core/signingLanes/WalletExecutionLaneProjection.d.ts +2 -11
  217. package/dist/types/wallet-server/src/core/signingLanes/signingWorkerLaneMaterialIdentity.d.ts +2 -19
  218. package/dist/types/wallet-server/src/core/thresholdEcdsaChainTarget.d.ts +3 -11
  219. package/dist/types/wallet-server/src/core/types.d.ts +2 -6
  220. package/dist/types/wallet-server/src/localIntendedMaterialAdmissionFault.d.ts +38 -0
  221. package/dist/types/wallet-server/src/localIntendedPresignCancellation.d.ts +4 -0
  222. package/dist/types/wallet-server/src/router/auth/authRequestValidation.d.ts +4 -9
  223. package/dist/types/wallet-server/src/router/auth/commonRouterUtils.d.ts +15 -1
  224. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthBoundary.d.ts +0 -1
  225. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthService.d.ts +1 -1
  226. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/walletSessionCredentialReaders.d.ts +9 -0
  227. package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/authorizedOperationStatements.d.ts +4 -0
  228. package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/d1AuthorizationStore.d.ts +10 -1
  229. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.d.ts +19 -2
  230. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.d.ts +2 -6
  231. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.d.ts +5 -8
  232. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpEnrollmentStore.d.ts +2 -8
  233. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.d.ts +2 -9
  234. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.d.ts +5 -5
  235. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.d.ts +4 -14
  236. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.d.ts +2 -6
  237. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +8 -6
  238. package/dist/types/wallet-server/src/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.d.ts +14 -1
  239. package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnRecords.d.ts +10 -39
  240. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOps.d.ts +8 -34
  241. package/dist/types/wallet-server/src/router/domains/ecdsa/thresholdEcdsaRequestValidation.d.ts +3 -15
  242. package/dist/types/wallet-server/src/router/domains/ed25519Yao/session/routerAbEd25519YaoWalletSession.d.ts +9 -50
  243. package/dist/types/wallet-server/src/router/domains/passkeyCustody/walletRecoveryKeyManifest.d.ts +1 -13
  244. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.d.ts +8 -9
  245. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbNormalSigningAdmission.d.ts +13 -0
  246. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbOperationStepUp.d.ts +3 -4
  247. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbPrivateSigningWorker.d.ts +7 -16
  248. package/dist/types/wallet-server/src/router/domains/syncAccount/syncAccountRequestValidation.d.ts +2 -7
  249. package/dist/types/wallet-server/src/router/framework/apiCredentialPorts.d.ts +3 -1
  250. package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +25 -4
  251. package/dist/types/wallet-server/src/router/framework/http.d.ts +1 -0
  252. package/dist/types/wallet-server/src/router/framework/ror/normalize.d.ts +1 -9
  253. package/dist/types/wallet-server/src/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.d.ts +3 -6
  254. package/dist/types/wallet-server/src/router/transport/fetch/routes/syncAccountBootstrap.d.ts +3 -5
  255. package/dist/types/wallet-server/src/router/transport/fetch/routes/thresholdEcdsa.d.ts +0 -1
  256. package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/idempotencyRecords.d.ts +1 -2
  257. package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/signingSessionSeal.types.d.ts +6 -8
  258. package/package.json +1 -1
  259. package/dist/esm/wasm/router_ab_ecdsa_signing_worker/pkg/router_ab_ecdsa_signing_worker_bg.wasm +0 -0
@@ -2,11 +2,15 @@ import { mpcMaterialActivationRefsEqual } from "../../../../shared-ts/src/utils/
2
2
  import { CAPABILITY_KINDS, parseAuthorizationAuditEventId, parseAuthorizationGrantRef, parseAuthorizedOperationId, parseCapabilityId, parseCapabilityOperationId, parseCapabilityOperationRef, parseMpcWalletSigningQuotaId, parsePrincipalId, parseTenantId, parseWalletSessionAuthorizationId, parseWalletSessionId } from "../../../../shared-ts/src/authorization/capabilityKinds.js";
3
3
  import { parseDigestB64u } from "../../../../shared-ts/src/utils/canonicalPrimitives.js";
4
4
  import { buildCapabilityOperationEnvelope, computeCapabilityOperationFingerprintDigest, parseCapabilityOperationFingerprintDigest } from "../../../../shared-ts/src/authorization/operationFingerprint.js";
5
- import { routerAbMpcMaterialActivationRefToWire, sameRouterAbMpcMaterialActivationRef } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
5
+ import { routerAbMpcMaterialActivationRefFromWire, routerAbMpcMaterialActivationRefToWire, sameRouterAbMpcMaterialActivationRef } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
6
6
  import { buildActiveWalletSessionQuota, buildAuthorizedOperation, buildExactWalletSessionQuotaProjectionV1, computeAuthorizedOperationResultDigest, exactWalletSessionCapabilitySubjectsResolveAuthority, parseAuthorizedOperationReplayResponse, parseHostedWalletSessionCredentialId, parseSessionOrigin, parseWalletSessionAuthorizationV2, walletSessionAuthorizationV2RecordsEqual } from "../../../../authorization/domain.js";
7
+ import { ECDSA_INSTALLATION_SNAPSHOT_COLUMNS } from "../../../../core/ecdsaMaterialReadSnapshot.js";
7
8
  import { d1ChangedRows, parseD1JsonColumn } from "../../../../storage/d1Sql.js";
9
+ import { EcdsaMaterialRead } from "../../../../core/d1EcdsaSignerRead.js";
8
10
  import { D1WalletStore } from "../../../../core/d1WalletStore.js";
9
11
  import { normalizeWalletAuthMethodV2 } from "../../../../core/d1WalletAuthMethodStore.js";
12
+ import { D1EcdsaAdmissionPolicyRead, ECDSA_CREDENTIAL_POLICY_PROJECTION } from "../signingAdmission/d1RouterAbNormalSigningAdmissionStore.js";
13
+ import { parseInstalledEcdsaCustodySnapshotV1 } from "../deviceLinking/d1LinkedDeviceAuthorityInstallService.js";
10
14
  import { prepareAuthorizedOperationAdmissionRead, prepareAuthorizedOperationCommittedRead, prepareAuthorizedOperationInsert, prepareAuthorizedOperationRead } from "./authorizedOperationStatements.js";
11
15
  import { prepareD1WalletSessionAuthorityProjectionStatements } from "./walletSessionAuthorityProjection.js";
12
16
  import { parseD1WalletAuthorityRow } from "../wallet/d1WalletAuthorityStore.js";
@@ -931,6 +935,7 @@ var CloudflareD1AuthorizationStore = class {
931
935
  }
932
936
  async readLiveWalletSessionAuthorizationProjectionV2(input) {
933
937
  const row = await this.readJoinedWalletSessionAuthorizationV2Row({
938
+ projection: { kind: "session" },
934
939
  lookupColumn: "authorization_id",
935
940
  tenantId: input.expected.tenantId,
936
941
  lookupValue: input.expected.authorizationId
@@ -989,26 +994,42 @@ var CloudflareD1AuthorizationStore = class {
989
994
  */
990
995
  async readWalletSessionAdmissionSnapshotByOperationCredential(input) {
991
996
  const row = await this.readJoinedWalletSessionAuthorizationV2Row({
997
+ projection: { kind: "session" },
992
998
  lookupColumn: "operation_credential_hash",
993
999
  tenantId: input.tenantId,
994
1000
  lookupValue: input.tokenHash
995
1001
  });
996
1002
  if (!row) return null;
997
- const session = parseLiveWalletSessionAuthorizationV2Row(row, {
998
- operationCredentialHash: input.tokenHash,
1003
+ return parseWalletSessionAdmissionRow(row, input);
1004
+ }
1005
+ async readEcdsaWalletSessionAdmissionSnapshotByOperationCredential(input) {
1006
+ const row = await this.readJoinedWalletSessionAuthorizationV2Row({
1007
+ projection: {
1008
+ kind: "ecdsa_material",
1009
+ materialActivation: input.materialActivation
1010
+ },
1011
+ lookupColumn: "operation_credential_hash",
999
1012
  tenantId: input.tenantId,
1000
- nowMs: input.nowMs
1013
+ lookupValue: input.tokenHash
1001
1014
  });
1015
+ if (!row) return null;
1016
+ const snapshot = await parseWalletSessionAdmissionRow(row, input);
1017
+ const session = snapshot.kind === "active" ? snapshot.authorization.session : snapshot.session;
1002
1018
  return {
1003
- authorization: {
1004
- session,
1005
- quota: parseWalletSessionAuthorizationV2QuotaRow(row, session)
1006
- },
1007
- ...await joinedAuthorityAndMethod(row)
1019
+ snapshot,
1020
+ materialRead: EcdsaMaterialRead.fromRows(this.walletSignerScope, session.walletId, input.materialActivation, parseD1JsonColumn(row.ecdsa_material_records_json), await parseInstalledEcdsaCustodySnapshotV1({
1021
+ scope: this.walletSignerScope,
1022
+ walletId: session.walletId,
1023
+ materialActivation: routerAbMpcMaterialActivationRefFromWire(input.materialActivation),
1024
+ installations: parseD1JsonColumn(row.ecdsa_installations_json),
1025
+ signers: parseD1JsonColumn(row.ecdsa_source_signers_json)
1026
+ })),
1027
+ policyRead: D1EcdsaAdmissionPolicyRead.fromRows(this.database, this.namespace, session.walletId, input.materialActivation.activation_id, parseD1JsonColumn(row.ecdsa_policy_records_json))
1008
1028
  };
1009
1029
  }
1010
1030
  async readWalletSessionExactOperationContextByCredential(input) {
1011
1031
  const row = await this.readJoinedWalletSessionAuthorizationV2Row({
1032
+ projection: { kind: "session" },
1012
1033
  lookupColumn: "operation_credential_hash",
1013
1034
  tenantId: input.tenantId,
1014
1035
  lookupValue: input.tokenHash
@@ -1058,6 +1079,7 @@ var CloudflareD1AuthorizationStore = class {
1058
1079
  });
1059
1080
  const nowMs = requirePositiveInteger(input.nowMs, "exact Wallet Session status time");
1060
1081
  const row = await this.readJoinedWalletSessionAuthorizationV2Row({
1082
+ projection: { kind: "session_status" },
1061
1083
  lookupColumn: "operation_credential_hash",
1062
1084
  tenantId: input.tenantId,
1063
1085
  lookupValue: input.tokenHash
@@ -1120,7 +1142,7 @@ var CloudflareD1AuthorizationStore = class {
1120
1142
  session,
1121
1143
  quota
1122
1144
  });
1123
- if (!await this.exactWalletSessionCapabilitySubjectsResolveMaterial(session)) return judged({
1145
+ if (!await this.exactWalletSessionCapabilitySubjectsResolveMaterial(session, parseD1JsonColumn(row.status_ecdsa_material_records_json))) return judged({
1124
1146
  kind: "capability_unavailable",
1125
1147
  session,
1126
1148
  quota
@@ -1131,15 +1153,20 @@ var CloudflareD1AuthorizationStore = class {
1131
1153
  quota
1132
1154
  });
1133
1155
  }
1134
- async exactWalletSessionCapabilitySubjectsResolveMaterial(session) {
1156
+ async exactWalletSessionCapabilitySubjectsResolveMaterial(session, ecdsaMaterialRows) {
1135
1157
  const materials = [];
1136
1158
  for (const subject of session.capabilitySubjects) switch (subject.kind) {
1137
1159
  case "sign":
1138
1160
  case "export_keys":
1139
- if (!materials.some((material) => material.keyFamily === subject.keyFamily && mpcMaterialActivationRefsEqual(material.materialActivation, subject.materialActivation))) materials.push({
1140
- keyFamily: subject.keyFamily,
1161
+ if (!materials.some((material) => material.keyFamily === subject.keyFamily && mpcMaterialActivationRefsEqual(material.materialActivation, subject.materialActivation))) if (subject.keyFamily === "ed25519") materials.push({
1162
+ keyFamily: "ed25519",
1141
1163
  materialActivation: subject.materialActivation
1142
1164
  });
1165
+ else materials.push({
1166
+ keyFamily: "ecdsa_secp256k1",
1167
+ materialActivation: subject.materialActivation,
1168
+ materialRead: EcdsaMaterialRead.fromRows(this.walletSignerScope, session.walletId, routerAbMpcMaterialActivationRefToWire(subject.materialActivation), ecdsaMaterialRows, null)
1169
+ });
1143
1170
  break;
1144
1171
  case "link_devices":
1145
1172
  case "revoke_devices": break;
@@ -1152,10 +1179,7 @@ var CloudflareD1AuthorizationStore = class {
1152
1179
  const signer = subject.keyFamily === "ed25519" ? await this.walletStore.getEd25519SignerByMaterialActivation({
1153
1180
  walletId,
1154
1181
  materialActivation
1155
- }) : await this.walletStore.getEcdsaSignerByMaterialActivation({
1156
- walletId,
1157
- materialActivation
1158
- });
1182
+ }) : subject.materialRead.resolve(this.walletSignerScope, walletId, materialActivation)?.signer;
1159
1183
  if (!signer) return await this.readLinkedAuthorityMaterial(walletId, subject) !== null;
1160
1184
  if (signer.walletId !== walletId) throw new Error("Stored wallet signer material identity does not match the session");
1161
1185
  return true;
@@ -1176,8 +1200,64 @@ var CloudflareD1AuthorizationStore = class {
1176
1200
  return projection;
1177
1201
  }
1178
1202
  async readJoinedWalletSessionAuthorizationV2Row(input) {
1179
- return await this.database.prepare(`SELECT
1203
+ const installationProjection = ECDSA_INSTALLATION_SNAPSHOT_COLUMNS.map(installationJsonColumn).join(", ");
1204
+ let materialProjection = "";
1205
+ let materialBindings = [];
1206
+ if (input.projection.kind === "ecdsa_material") {
1207
+ materialProjection = `
1208
+ (SELECT json_group_array(json_object('record_json', signer.record_json))
1209
+ FROM wallet_signers AS signer
1210
+ WHERE signer.namespace = session.namespace
1211
+ AND signer.org_id = session.org_id
1212
+ AND signer.project_id = session.project_id
1213
+ AND signer.env_id = session.env_id
1214
+ AND signer.wallet_id = session.wallet_id
1215
+ AND signer.signer_family = 'ecdsa'
1216
+ AND CASE WHEN json_valid(signer.record_json) THEN
1217
+ json_extract(signer.record_json,
1218
+ '$.walletKey.publicCapability.material_activation.activation_id') = ?
1219
+ ELSE 1 END
1220
+ ) AS ecdsa_material_records_json,
1221
+ CASE WHEN authority.provenance_kind = 'device_link' THEN
1222
+ (SELECT json_group_array(json_object(${installationProjection}))
1223
+ FROM linked_device_authority_installations AS installation
1224
+ WHERE installation.namespace = session.namespace
1225
+ AND installation.org_id = session.org_id
1226
+ AND installation.project_id = session.project_id
1227
+ AND installation.env_id = session.env_id
1228
+ AND installation.wallet_id = session.wallet_id)
1229
+ END AS ecdsa_installations_json,
1230
+ CASE WHEN authority.provenance_kind = 'device_link' THEN
1231
+ (SELECT json_group_array(json_object('record_json', source_signer.record_json))
1232
+ FROM wallet_signers AS source_signer
1233
+ WHERE source_signer.namespace = session.namespace
1234
+ AND source_signer.org_id = session.org_id
1235
+ AND source_signer.project_id = session.project_id
1236
+ AND source_signer.env_id = session.env_id
1237
+ AND source_signer.wallet_id = session.wallet_id
1238
+ AND source_signer.signer_family = 'ecdsa')
1239
+ END AS ecdsa_source_signers_json,
1240
+ ${ECDSA_CREDENTIAL_POLICY_PROJECTION}`;
1241
+ materialBindings = [input.projection.materialActivation.activation_id, input.projection.materialActivation.activation_id];
1242
+ } else if (input.projection.kind === "session_status") {
1243
+ materialProjection = `
1244
+ (SELECT json_group_array(json_object('record_json', signer.record_json))
1245
+ FROM wallet_signers AS signer
1246
+ WHERE signer.namespace = ? AND signer.org_id = ?
1247
+ AND signer.project_id = ? AND signer.env_id = ?
1248
+ AND signer.wallet_id = session.wallet_id
1249
+ AND signer.signer_family = 'ecdsa'
1250
+ ) AS status_ecdsa_material_records_json,`;
1251
+ materialBindings = [
1252
+ this.walletSignerScope.namespace,
1253
+ this.walletSignerScope.orgId,
1254
+ this.walletSignerScope.projectId,
1255
+ this.walletSignerScope.envId
1256
+ ];
1257
+ }
1258
+ return await this.database.prepare(`SELECT ${materialProjection}
1180
1259
  authority.*,
1260
+ session.namespace AS session_namespace,
1181
1261
  session.record_json AS session_record_json,
1182
1262
  session.capability_subjects_json AS session_capability_subjects_json,
1183
1263
  session.tenant_id AS session_tenant_id,
@@ -1240,12 +1320,13 @@ var CloudflareD1AuthorizationStore = class {
1240
1320
  AND session.env_id = ?
1241
1321
  AND session.tenant_id = ?
1242
1322
  AND session.${input.lookupColumn} = ?
1243
- LIMIT 1`).bind(this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, this.namespace, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, input.tenantId, input.lookupValue).first();
1323
+ LIMIT 1`).bind(...materialBindings, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, this.namespace, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, input.tenantId, input.lookupValue).first();
1244
1324
  }
1245
1325
  async readWalletSessionAuthorizationV2(input, lookupColumn) {
1246
1326
  const lookup = "expected" in input ? input.expected : "identity" in input ? input.identity : null;
1247
1327
  const operationCredentialHash = "operationCredentialHash" in input ? input.operationCredentialHash : null;
1248
1328
  const row = await this.readJoinedWalletSessionAuthorizationV2Row({
1329
+ projection: { kind: "session" },
1249
1330
  lookupColumn,
1250
1331
  tenantId: "operationCredentialHash" in input ? input.tenantId : lookup?.tenantId,
1251
1332
  lookupValue: lookupColumn === "mint_id" ? String("expected" in input ? input.expected.mintId : lookup?.authorizationId) : lookupColumn === "authorization_id" ? String(lookup?.authorizationId) : operationCredentialHash
@@ -1296,20 +1377,16 @@ var CloudflareD1AuthorizationStore = class {
1296
1377
  database: this.database,
1297
1378
  namespace: this.namespace,
1298
1379
  walletSignerScope: this.walletSignerScope,
1380
+ materialSnapshot: input.materialSnapshot,
1299
1381
  tenantId: input.tenantId,
1300
1382
  operationFingerprintDigest: input.operationFingerprintDigest,
1301
1383
  nowMs: requirePositiveInteger(input.nowMs, "operation replay time")
1302
1384
  }).first();
1303
- if (!row) return null;
1304
- if (row.authorization_source_active !== 0 && row.authorization_source_active !== 1) throw new Error("Authorized operation source status must be a SQL boolean");
1305
- return {
1306
- row,
1307
- operation: await parseAuthorizedOperationRow(row),
1308
- sourceActive: row.authorization_source_active === 1
1309
- };
1385
+ return row ? parseAuthorizedOperationAdmissionRecord(row) : null;
1310
1386
  }
1311
1387
  /** How an operation already admitted for this fingerprint answers another admission. */
1312
1388
  answerExistingAuthorizedOperation(existing, operation, material) {
1389
+ if (!existing.materialActive) return { kind: "material_mismatch" };
1313
1390
  const replayMismatch = authorizedOperationReplayMismatch({
1314
1391
  existing: existing.row,
1315
1392
  incoming: operation,
@@ -1343,7 +1420,8 @@ var CloudflareD1AuthorizationStore = class {
1343
1420
  const existing = await this.readAuthorizedOperationForAdmission({
1344
1421
  tenantId: operation.tenantId,
1345
1422
  operationFingerprintDigest: operation.operationFingerprintDigest,
1346
- nowMs: operation.claimedAtMs
1423
+ nowMs: operation.claimedAtMs,
1424
+ materialSnapshot: null
1347
1425
  });
1348
1426
  if (existing) {
1349
1427
  const result = this.answerExistingAuthorizedOperation(existing, operation, void 0);
@@ -1360,7 +1438,9 @@ var CloudflareD1AuthorizationStore = class {
1360
1438
  namespace: this.namespace,
1361
1439
  walletSignerScope: this.walletSignerScope,
1362
1440
  operation,
1363
- material: null
1441
+ material: null,
1442
+ materialSnapshot: null,
1443
+ existingOperation: "reject"
1364
1444
  })]
1365
1445
  };
1366
1446
  }
@@ -1368,17 +1448,50 @@ var CloudflareD1AuthorizationStore = class {
1368
1448
  return classifyAuthorizedOperationAdmissionError(error);
1369
1449
  }
1370
1450
  async admitAuthorizedOperation(input) {
1371
- const result = await this.admitAuthorizedOperationRecord(input);
1451
+ const result = await this.admitAuthorizedOperationRecord({
1452
+ operation: input.operation,
1453
+ material: input.material,
1454
+ materialSnapshot: null
1455
+ });
1372
1456
  if (result.kind === "claimed" || result.kind === "replayed" || result.kind === "operation_in_progress") return {
1373
1457
  kind: result.kind,
1374
1458
  operation: result.operation
1375
1459
  };
1376
1460
  return result;
1377
1461
  }
1462
+ async resolveEcdsaWalletSessionOperation(input) {
1463
+ const operation = await buildAuthorizedOperation(input.operation);
1464
+ if (!authorizedOperationMaterialScopeMatches(operation, input.material, input.material.readSnapshot)) return { kind: "material_mismatch" };
1465
+ const existing = await this.readAuthorizedOperationForAdmission({
1466
+ tenantId: operation.tenantId,
1467
+ operationFingerprintDigest: operation.operationFingerprintDigest,
1468
+ nowMs: operation.claimedAtMs,
1469
+ materialSnapshot: input.material.readSnapshot
1470
+ });
1471
+ if (!existing) return { kind: "authorized_operation_missing" };
1472
+ const result = this.answerExistingAuthorizedOperation(existing, operation, input.material);
1473
+ if (result.kind === "operation_in_progress") return {
1474
+ kind: result.kind,
1475
+ operation: result.operation,
1476
+ ownerScope: this.pinnedWalletSessionOwnerScope(result.row, input.material.walletId)
1477
+ };
1478
+ if (result.kind === "replayed") return {
1479
+ kind: result.kind,
1480
+ operation: result.operation
1481
+ };
1482
+ switch (result.kind) {
1483
+ case "authorization_grant_rejected":
1484
+ case "verified_step_up_rejected":
1485
+ case "wallet_session_quota_exhausted":
1486
+ case "material_mismatch": return result;
1487
+ default: throw new Error("Unexpected ECDSA operation resolution");
1488
+ }
1489
+ }
1378
1490
  async admitEcdsaWalletSessionOperation(input) {
1379
1491
  const result = await this.admitAuthorizedOperationRecord({
1380
1492
  operation: input.operation,
1381
- material: input.material
1493
+ material: input.material,
1494
+ materialSnapshot: input.material.readSnapshot
1382
1495
  });
1383
1496
  switch (result.kind) {
1384
1497
  case "claimed":
@@ -1403,42 +1516,52 @@ var CloudflareD1AuthorizationStore = class {
1403
1516
  }
1404
1517
  async admitAuthorizedOperationRecord(input) {
1405
1518
  const operation = await buildAuthorizedOperation(input.operation);
1406
- if (operation.operation.operation.capabilityKind === CAPABILITY_KINDS.evmEcdsaMpcSigning && !input.material) return { kind: "material_mismatch" };
1407
- if (input.material && input.material.kind === "ecdsa_material_activation" && (operation.operation.operation.capabilityKind !== CAPABILITY_KINDS.evmEcdsaMpcSigning || input.material.runtimePolicyScope.orgId !== operation.tenantId || input.material.materialActivation.capability !== operation.operation.capabilityId || input.material.materialActivation.material_owner !== input.material.walletId)) return { kind: "material_mismatch" };
1408
- const existing = await this.readAuthorizedOperationForAdmission({
1409
- tenantId: operation.tenantId,
1410
- operationFingerprintDigest: operation.operationFingerprintDigest,
1411
- nowMs: operation.claimedAtMs
1412
- });
1413
- if (existing) return this.answerExistingAuthorizedOperation(existing, operation, input.material);
1519
+ if (!authorizedOperationMaterialScopeMatches(operation, input.material, input.materialSnapshot)) return { kind: "material_mismatch" };
1414
1520
  let committedRow;
1521
+ let claimed;
1415
1522
  try {
1416
1523
  const statement = prepareAuthorizedOperationInsert({
1417
1524
  database: this.database,
1418
1525
  namespace: this.namespace,
1419
1526
  walletSignerScope: this.walletSignerScope,
1420
1527
  operation,
1421
- material: input.material ?? null
1528
+ material: input.material ?? null,
1529
+ materialSnapshot: input.materialSnapshot,
1530
+ existingOperation: "preserve"
1422
1531
  });
1423
- const [result, readback] = await this.database.batch([statement, prepareAuthorizedOperationCommittedRead(this.database, this.namespace, operation)]);
1532
+ const [result, readback] = await this.database.batch([statement, prepareAuthorizedOperationAdmissionRead({
1533
+ database: this.database,
1534
+ namespace: this.namespace,
1535
+ walletSignerScope: this.walletSignerScope,
1536
+ tenantId: operation.tenantId,
1537
+ operationFingerprintDigest: operation.operationFingerprintDigest,
1538
+ nowMs: operation.claimedAtMs,
1539
+ materialSnapshot: input.materialSnapshot
1540
+ })]);
1424
1541
  if (!result?.success || !readback?.success) throw new Error("authorized operation admission batch returned incomplete results");
1425
- if (input.material && d1ChangedRows(result) === 0) return { kind: "material_mismatch" };
1542
+ claimed = d1ChangedRows(result) !== 0;
1426
1543
  committedRow = readback.results?.[0] ?? null;
1427
1544
  } catch (error) {
1428
1545
  const raced = await this.readAuthorizedOperationForAdmission({
1429
1546
  tenantId: operation.tenantId,
1430
1547
  operationFingerprintDigest: operation.operationFingerprintDigest,
1431
- nowMs: operation.claimedAtMs
1548
+ nowMs: operation.claimedAtMs,
1549
+ materialSnapshot: input.materialSnapshot
1432
1550
  });
1433
1551
  if (raced) return this.answerExistingAuthorizedOperation(raced, operation, input.material);
1434
1552
  const triggerFailure = classifyAuthorizedOperationAdmissionError(error);
1435
1553
  if (triggerFailure) return triggerFailure;
1436
1554
  throw error;
1437
1555
  }
1438
- if (!committedRow) throw new Error("authorized operation admission could not be read back");
1556
+ if (!committedRow) {
1557
+ if (!claimed && input.material) return { kind: "material_mismatch" };
1558
+ throw new Error("authorized operation admission could not be read back");
1559
+ }
1560
+ const admitted = await parseAuthorizedOperationAdmissionRecord(committedRow);
1561
+ if (!claimed) return this.answerExistingAuthorizedOperation(admitted, operation, input.material);
1439
1562
  return {
1440
1563
  kind: "claimed",
1441
- operation: await parseAuthorizedOperationRow(committedRow),
1564
+ operation: admitted.operation,
1442
1565
  row: committedRow
1443
1566
  };
1444
1567
  }
@@ -1498,6 +1621,21 @@ var CloudflareD1AuthorizationStore = class {
1498
1621
  LIMIT 1`).bind(this.namespace, this.walletSignerScope.orgId, this.walletSignerScope.projectId, this.walletSignerScope.envId, codeHash).first();
1499
1622
  }
1500
1623
  };
1624
+ async function parseAuthorizedOperationAdmissionRecord(row) {
1625
+ if (row.authorization_source_active !== 0 && row.authorization_source_active !== 1) throw new Error("Authorized operation source status must be a SQL boolean");
1626
+ return {
1627
+ row,
1628
+ operation: await parseAuthorizedOperationRow(row),
1629
+ sourceActive: row.authorization_source_active === 1,
1630
+ materialActive: row.material_snapshot_active === 1
1631
+ };
1632
+ }
1633
+ function authorizedOperationMaterialScopeMatches(operation, material, snapshot) {
1634
+ if (snapshot && snapshot.walletId !== material?.walletId) return false;
1635
+ const requiresMaterial = operation.operation.operation.capabilityKind === CAPABILITY_KINDS.evmEcdsaMpcSigning;
1636
+ if (!material) return !requiresMaterial;
1637
+ return requiresMaterial && material.runtimePolicyScope.orgId === operation.tenantId && material.materialActivation.capability === operation.operation.capabilityId && material.materialActivation.material_owner === material.walletId;
1638
+ }
1501
1639
  function classifyAuthorizedOperationAdmissionError(error) {
1502
1640
  const message = error instanceof Error ? error.message : String(error);
1503
1641
  if (message.includes("authorization_wallet_session_quota_rejected")) return { kind: "wallet_session_quota_exhausted" };
@@ -1805,6 +1943,33 @@ function parseExactWalletSessionQuotaProjectionRow(row, session) {
1805
1943
  function assertNeverDirectV2CommitMode(value) {
1806
1944
  throw new Error(`Unsupported direct V2 Wallet Session commit mode: ${String(value)}`);
1807
1945
  }
1946
+ async function parseWalletSessionAdmissionRow(row, input) {
1947
+ const session = parseLiveWalletSessionAuthorizationV2Row(row, {
1948
+ operationCredentialHash: input.tokenHash,
1949
+ tenantId: input.tenantId,
1950
+ nowMs: input.nowMs
1951
+ });
1952
+ const { authority, authMethod } = await joinedAuthorityAndMethod(row);
1953
+ if (row.quota_lifecycle_kind === "exhausted") return {
1954
+ kind: "exhausted",
1955
+ session,
1956
+ quota: parseExactWalletSessionQuotaProjectionRow(row, session),
1957
+ authority,
1958
+ authMethod
1959
+ };
1960
+ return {
1961
+ kind: "active",
1962
+ authorization: {
1963
+ session,
1964
+ quota: parseWalletSessionAuthorizationV2QuotaRow(row, session)
1965
+ },
1966
+ authority,
1967
+ authMethod
1968
+ };
1969
+ }
1970
+ function installationJsonColumn(column) {
1971
+ return `'${column}', installation.${column}`;
1972
+ }
1808
1973
  //#endregion
1809
1974
  export { CloudflareD1AuthorizationStore };
1810
1975
 
@@ -2,6 +2,7 @@ import { parseCapabilityId, parseTenantId, parseVaultId, parseVaultItemId } from
2
2
  import { base64UrlDecode, base64UrlEncode } from "../../../../shared-ts/src/utils/base64.js";
3
3
  import { alphabetizeStringify } from "../../../../shared-ts/src/utils/digests.js";
4
4
  import { parseVaultProxyDestination } from "../../../../authorization/vaultProxyUse.js";
5
+ import { toArrayBufferCopy } from "../../../../core/authService/portableCrypto.js";
5
6
  //#region src/router/cloudflare/d1/authorization/d1VaultProxyStore.ts
6
7
  const VAULT_PROXY_SECRET_AAD_DOMAIN_V1 = "seams:vault:proxy-secret:v1";
7
8
  const AES_GCM_NONCE_BYTES = 12;
@@ -21,10 +22,10 @@ var CloudflareD1VaultProxyStore = class {
21
22
  try {
22
23
  const ciphertext = await crypto.subtle.encrypt({
23
24
  name: "AES-GCM",
24
- iv: toArrayBuffer(nonce),
25
- additionalData: toArrayBuffer(aad(input)),
25
+ iv: toArrayBufferCopy(nonce),
26
+ additionalData: toArrayBufferCopy(aad(input)),
26
27
  tagLength: 128
27
- }, await this.key, toArrayBuffer(plaintext));
28
+ }, await this.key, toArrayBufferCopy(plaintext));
28
29
  await this.database.prepare(`INSERT INTO vault_proxy_secrets (
29
30
  namespace,
30
31
  tenant_id,
@@ -65,10 +66,10 @@ var CloudflareD1VaultProxyStore = class {
65
66
  try {
66
67
  return new Uint8Array(await crypto.subtle.decrypt({
67
68
  name: "AES-GCM",
68
- iv: toArrayBuffer(nonce),
69
- additionalData: toArrayBuffer(aad(input)),
69
+ iv: toArrayBufferCopy(nonce),
70
+ additionalData: toArrayBufferCopy(aad(input)),
70
71
  tagLength: 128
71
- }, await this.key, toArrayBuffer(ciphertext)));
72
+ }, await this.key, toArrayBufferCopy(ciphertext)));
72
73
  } finally {
73
74
  nonce.fill(0);
74
75
  ciphertext.fill(0);
@@ -77,7 +78,7 @@ var CloudflareD1VaultProxyStore = class {
77
78
  };
78
79
  async function importEncryptionKey(bytes) {
79
80
  try {
80
- return await crypto.subtle.importKey("raw", toArrayBuffer(bytes), { name: "AES-GCM" }, false, ["encrypt", "decrypt"]);
81
+ return await crypto.subtle.importKey("raw", toArrayBufferCopy(bytes), { name: "AES-GCM" }, false, ["encrypt", "decrypt"]);
81
82
  } finally {
82
83
  bytes.fill(0);
83
84
  }
@@ -111,11 +112,6 @@ function requireCompactString(value, label) {
111
112
  if (typeof value !== "string" || !value || value.trim() !== value) throw new Error(`vault proxy ${label} is invalid`);
112
113
  return value;
113
114
  }
114
- function toArrayBuffer(bytes) {
115
- const copy = new ArrayBuffer(bytes.byteLength);
116
- new Uint8Array(copy).set(bytes);
117
- return copy;
118
- }
119
115
  //#endregion
120
116
  export { CloudflareD1VaultProxyStore };
121
117
 
@@ -3,8 +3,9 @@ import { parseDeviceId, parsePrincipalId, parseTenantId, parseWalletSessionMintI
3
3
  import { base64UrlDecode, base64UrlEncode } from "../../../../shared-ts/src/utils/base64.js";
4
4
  import { alphabetizeStringify, sha256BytesUtf8 } from "../../../../shared-ts/src/utils/digests.js";
5
5
  import { parseDigestB64u } from "../../../../shared-ts/src/utils/canonicalPrimitives.js";
6
+ import { isPlainObject } from "../../../../shared-ts/src/utils/validation.js";
6
7
  import { buildDelegatedWalletAuthorityV1, parseDelegatedWalletPermissionSetV1, validateDelegatedWalletAuthorityAttenuationV1 } from "../../../../shared-ts/src/authorization/delegatedAuthority.js";
7
- import { routerAbMpcMaterialActivationRefFromWire } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
8
+ import { routerAbMpcMaterialActivationRefFromWire, routerAbMpcMaterialActivationRefToWire } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
8
9
  import { parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, sameRouterAbEd25519YaoActivationBindingV1 } from "../../../../shared-ts/src/utils/routerAbEd25519Yao.js";
9
10
  import { assertLinkedDeviceOrdinaryMaterialSourceContributionMatchesContextV1, parseLinkedDeviceEcdsaSourceContributionPackageV1, parseLinkedDeviceEcdsaSourceDerivationV1, parseLinkedDeviceOrdinaryMaterialSourceContributionV1 } from "../../../../shared-ts/src/device-linking/sourceContribution.js";
10
11
  import { buildWalletAuthMethodRecordV2, sameWalletAuthMethodRecordV2 } from "../../../../shared-ts/src/utils/walletAuthMethodRecord.js";
@@ -17,12 +18,14 @@ import { computeWalletSessionInstallationReceiptDigestB64u, computeWalletSession
17
18
  import { computeLinkedDevicePublicKeyDigestV1 } from "../../../../shared-ts/src/device-linking/requestProof.js";
18
19
  import { buildPersistedActiveWalletSessionAuthorizationV2, walletSessionAuthorizationV2RecordsEqual } from "../../../../authorization/domain.js";
19
20
  import { secureRandomBase64Url } from "../../../../shared-ts/src/utils/secureRandomId.js";
21
+ import { EcdsaMaterialReadSnapshot } from "../../../../core/ecdsaMaterialReadSnapshot.js";
20
22
  import { parseD1JsonColumn } from "../../../../storage/d1Sql.js";
23
+ import { parseWalletEcdsaSignerRows, prepareWalletEcdsaSignersRead } from "../../../../core/d1EcdsaSignerRead.js";
21
24
  import "../../../../core/deviceLinking/requestProof.js";
22
25
  import { prepareD1WebAuthnCredentialBindingInsertStatement } from "../../../../core/WebAuthnCredentialBindingStore.js";
23
26
  import { prepareD1WebAuthnAuthenticatorInsertStatement } from "../webauthn/d1WebAuthnStore.js";
24
- import { buildAuthorityActiveSessionRecordV1, buildAuthorityPendingLocalInstallSessionRecordV1 } from "../../../../core/deviceLinking/linkedDeviceSessionRecord.js";
25
27
  import { findInstalledEcdsaAuthority, installedEcdsaAuthorityChain, projectInstalledEcdsaAuthority } from "./installedEcdsaAuthority.js";
28
+ import { buildAuthorityActiveSessionRecordV1, buildAuthorityPendingLocalInstallSessionRecordV1 } from "../../../../core/deviceLinking/linkedDeviceSessionRecord.js";
26
29
  import { linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./d1LinkedDeviceSourceContributionPreparationPlanner.js";
27
30
  //#region src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.ts
28
31
  var LinkedDeviceActivationIntegrityErrorV1 = class extends Error {
@@ -471,11 +474,20 @@ var D1LinkedDeviceAuthorityInstallServiceV1 = class {
471
474
  return null;
472
475
  }
473
476
  }
474
- async readInstalledEcdsaAuthorityChainByMaterialActivationV1(input) {
477
+ async readInstalledEcdsaCustodySnapshotV1(input) {
475
478
  try {
476
- return installedEcdsaAuthorityChain(await this.readVerifiedEcdsaInstallations(input.walletId), input.materialActivation);
479
+ if (input.source.kind === "credential_snapshot") return input.source.materialRead.resolveLinked(this.options.scope, input.walletId, routerAbMpcMaterialActivationRefToWire(input.materialActivation));
480
+ const [installations, signers] = await this.options.database.batch([this.prepareInstallationsByWalletRead(input.walletId), prepareWalletEcdsaSignersRead(this.options.database, this.options.scope, input.walletId)]);
481
+ if (!installations?.success || !signers?.success) throw new Error("Linked ECDSA custody snapshot is incomplete");
482
+ return await parseInstalledEcdsaCustodySnapshotV1({
483
+ scope: this.options.scope,
484
+ walletId: input.walletId,
485
+ materialActivation: input.materialActivation,
486
+ installations: installations.results ?? [],
487
+ signers: signers.results ?? []
488
+ });
477
489
  } catch {
478
- return [];
490
+ return null;
479
491
  }
480
492
  }
481
493
  async readVerifiedEcdsaInstallations(walletId) {
@@ -1023,12 +1035,42 @@ var D1LinkedDeviceAuthorityInstallServiceV1 = class {
1023
1035
  return await readStoredInstallationByAuthorityV1(this.options, authorityId);
1024
1036
  }
1025
1037
  async readInstallationsByWallet(walletId) {
1026
- return ((await this.options.database.prepare(`SELECT * FROM linked_device_authority_installations
1038
+ return ((await this.prepareInstallationsByWalletRead(walletId).all()).results ?? []).map(parseStoredInstallationRow);
1039
+ }
1040
+ prepareInstallationsByWalletRead(walletId) {
1041
+ return this.options.database.prepare(`SELECT * FROM linked_device_authority_installations
1027
1042
  WHERE namespace = ? AND org_id = ? AND project_id = ? AND env_id = ?
1028
1043
  AND wallet_id = ?
1029
- ORDER BY link_session_id ASC`).bind(this.options.scope.namespace, this.options.scope.orgId, this.options.scope.projectId, this.options.scope.envId, String(walletId)).all()).results ?? []).map(parseStoredInstallationRow);
1044
+ ORDER BY link_session_id ASC`).bind(this.options.scope.namespace, this.options.scope.orgId, this.options.scope.projectId, this.options.scope.envId, String(walletId));
1030
1045
  }
1031
1046
  };
1047
+ async function parseInstalledEcdsaCustodySnapshotV1(input) {
1048
+ try {
1049
+ if (!Array.isArray(input.installations) || !Array.isArray(input.signers)) return null;
1050
+ const installations = [];
1051
+ const signers = [];
1052
+ for (const row of input.installations) {
1053
+ if (!isPlainObject(row)) return null;
1054
+ installations.push(row);
1055
+ }
1056
+ for (const row of input.signers) {
1057
+ if (!isPlainObject(row)) return null;
1058
+ signers.push(row);
1059
+ }
1060
+ const rows = installations.map(parseStoredInstallationRow);
1061
+ for (const row of rows) {
1062
+ if (row.walletId !== input.walletId) return null;
1063
+ await assertStoredPackageDigest(row);
1064
+ }
1065
+ return {
1066
+ readSnapshot: EcdsaMaterialReadSnapshot.linked(input.scope, input.walletId, installations, signers),
1067
+ chain: installedEcdsaAuthorityChain(rows, input.materialActivation),
1068
+ signers: parseWalletEcdsaSignerRows(signers, input.walletId)
1069
+ };
1070
+ } catch {
1071
+ return null;
1072
+ }
1073
+ }
1032
1074
  async function readStoredInstallationByAuthorityV1(sql, authorityId) {
1033
1075
  const row = await sql.database.prepare(`SELECT * FROM linked_device_authority_installations
1034
1076
  WHERE namespace = ? AND org_id = ? AND project_id = ? AND env_id = ?
@@ -1825,6 +1867,6 @@ function errorMessage(error) {
1825
1867
  return error instanceof Error ? error.message : String(error);
1826
1868
  }
1827
1869
  //#endregion
1828
- export { D1LinkedDeviceAuthorityInstallServiceV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 };
1870
+ export { D1LinkedDeviceAuthorityInstallServiceV1, parseInstalledEcdsaCustodySnapshotV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 };
1829
1871
 
1830
1872
  //# sourceMappingURL=d1LinkedDeviceAuthorityInstallService.js.map
@@ -10,10 +10,10 @@ import { assertLinkedDeviceTargetCredentialRegistrationMatchesPreparationV1, com
10
10
  import { d1ChangedRows } from "../../../../storage/d1Sql.js";
11
11
  import { errorMessage } from "../../../../shared-ts/src/utils/errors.js";
12
12
  import { parseClientDataJsonBase64url } from "../../../../core/authService/webauthnOidcHelpers.js";
13
+ import { linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./d1LinkedDeviceSourceContributionPreparationPlanner.js";
13
14
  import { verifyWebAuthnRegistrationCredentialForIntent } from "../../../../core/authService/webauthn.js";
14
15
  import { SESSION_CAS_GUARD_SQL } from "./d1LinkedDeviceSessionStore.js";
15
16
  import { linkedDeviceEmailOtpDescriptorCredentialIdV1 } from "../../../../core/deviceLinking/linkedDeviceEmailOtpGrant.js";
16
- import { linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./d1LinkedDeviceSourceContributionPreparationPlanner.js";
17
17
  import { buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1 } from "./d1LinkedDeviceVerifiedLinkBuilder.js";
18
18
  //#region src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.ts
19
19
  /** Verifies the browser-signed ceremony origin against the configured RP ID. */
@@ -1,15 +1,15 @@
1
+ import { D1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./d1LinkedDeviceSourceContributionPreparationPlanner.js";
2
+ import { D1LinkedDeviceAuthorityInstallServiceV1, parseInstalledEcdsaCustodySnapshotV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 } from "./d1LinkedDeviceAuthorityInstallService.js";
1
3
  import { D1LinkedDeviceEd25519ExportRootStoreV1 } from "./d1LinkedDeviceEd25519ExportRootStore.js";
2
4
  import { D1LinkedDeviceRequestProofNonceStoreV1 } from "./d1LinkedDeviceRequestProofNonceStore.js";
3
5
  import { createD1LinkedDeviceSessionServiceV1 } from "./d1LinkedDeviceSessionService.js";
4
6
  import { parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1 } from "./d1LinkedDeviceSessionRecords.js";
5
7
  import { D1LinkedDeviceSessionStoreV1, SESSION_CAS_GUARD_SQL } from "./d1LinkedDeviceSessionStore.js";
6
8
  import { createD1LinkedDeviceRouteServiceV1 } from "./d1LinkedDeviceRouteService.js";
7
- import { D1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./d1LinkedDeviceSourceContributionPreparationPlanner.js";
8
- import { D1LinkedDeviceAuthorityInstallServiceV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 } from "./d1LinkedDeviceAuthorityInstallService.js";
9
9
  import { LinkedDeviceSourceFamilyUnavailableErrorV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1 } from "./d1LinkedDeviceVerifiedLinkSourceReader.js";
10
10
  import { buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, computeVerifiedTargetFactorVerificationDigestV1, linkedDeviceSignerManifestsEqualV1 } from "./d1LinkedDeviceVerifiedLinkBuilder.js";
11
11
  import { D1LinkedDeviceTargetCredentialProviderV1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1 } from "./d1LinkedDeviceTargetCredentialProvider.js";
12
12
  import { D1LinkedDeviceTargetPlannerV1 } from "./d1LinkedDeviceTargetPlanner.js";
13
13
  import { createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1 } from "./d1LinkedDeviceOwnerAuthorizationProvider.js";
14
14
  import { D1LinkedDeviceTargetAuthenticatorStoreV1 } from "./d1LinkedDeviceTargetAuthenticatorStore.js";
15
- export { D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, SESSION_CAS_GUARD_SQL, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, computeVerifiedTargetFactorVerificationDigestV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 };
15
+ export { D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, SESSION_CAS_GUARD_SQL, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, computeVerifiedTargetFactorVerificationDigestV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, parseInstalledEcdsaCustodySnapshotV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 };