@@ -75,11 +75,12 @@ export const getUserIdFromAuthToken = async (params: {
7575 * @param clientSessionId - Optional session ID
7676 * @returns A UsageResponse object containing usage metrics and referral information
7777 */
78- export async function genUsageResponse (
79- fingerprintId : string ,
80- userId : string ,
81- clientSessionId : string | undefined ,
82- ) : Promise < UsageResponse > {
78+ export async function genUsageResponse ( params : {
79+ fingerprintId : string
80+ userId : string
81+ clientSessionId ?: string
82+ } ) : Promise < UsageResponse > {
83+ const { fingerprintId, userId, clientSessionId } = params
8384 const logContext = { fingerprintId, userId, sessionId : clientSessionId }
8485 const defaultResp = {
8586 type : 'usage-response' as const ,
@@ -180,11 +181,10 @@ const onPrompt = async (
180181 } )
181182 } finally {
182183 cancelUserInput ( { userId, userInputId : promptId } )
183- const usageResponse = await genUsageResponse (
184+ const usageResponse = await genUsageResponse ( {
184185 fingerprintId,
185186 userId,
186- undefined ,
187- )
187+ } )
188188 sendAction ( ws , usageResponse )
189189 }
190190 } ,
@@ -298,11 +298,11 @@ const onInit = async (
298298 }
299299
300300 // Send combined init and usage response
301- const usageResponse = await genUsageResponse (
301+ const usageResponse = await genUsageResponse ( {
302302 fingerprintId,
303303 userId,
304304 clientSessionId,
305- )
305+ } )
306306 sendAction ( ws , {
307307 ...usageResponse ,
308308 type : 'init-response' ,
0 commit comments