File tree Expand file tree Collapse file tree
packages/provider-cursor/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ export const readCursorAccountUsage = Effect.fn("readCursorAccountUsage")(functi
123123 Effect . map ( ( credentials ) => object ( credentials ) . accessToken ) ,
124124 )
125125 : credentialSource . kind === "apiKey"
126- ? exchangeCursorApiKey ( DEFAULT_CURSOR_API_ENDPOINT , credentialSource . apiKey ) . pipe (
126+ ? exchangeCursorApiKey ( credentialSource . apiKey ) . pipe (
127127 Effect . provideService ( HttpClient . HttpClient , httpClient ) ,
128128 Effect . mapError (
129129 ( ) => new CursorAccountUsageInvalidError ( { reason : "Invalid API key" } ) ,
Original file line number Diff line number Diff line change @@ -9,13 +9,10 @@ export const DEFAULT_CURSOR_API_ENDPOINT = "https://api2.cursor.sh";
99const ApiKeyExchange = Schema . Struct ( { accessToken : Schema . NonEmptyString } ) ;
1010
1111/** Trades a user API key for the access token Cursor's RPCs accept, as `@cursor/sdk` does. */
12- export const exchangeCursorApiKey = Effect . fn ( "exchangeCursorApiKey" ) ( function * (
13- endpoint : string ,
14- apiKey : string ,
15- ) {
12+ export const exchangeCursorApiKey = Effect . fn ( "exchangeCursorApiKey" ) ( function * ( apiKey : string ) {
1613 const client = yield * HttpClient . HttpClient ;
1714 const response = yield * client . execute (
18- HttpClientRequest . post ( `${ endpoint } /auth/exchange_user_api_key` ) . pipe (
15+ HttpClientRequest . post ( `${ DEFAULT_CURSOR_API_ENDPOINT } /auth/exchange_user_api_key` ) . pipe (
1916 HttpClientRequest . bearerToken ( apiKey ) ,
2017 HttpClientRequest . bodyJsonUnsafe ( { } ) ,
2118 ) ,
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export const readCursorUsageLimits = Effect.fn("readCursorUsageLimits")(function
8888 message : "Cursor usage for an API key requires the default Cursor endpoint." ,
8989 } ) ;
9090 }
91- token = yield * exchangeCursorApiKey ( endpoint , apiKey ) ;
91+ token = yield * exchangeCursorApiKey ( apiKey ) ;
9292 } else if ( ! token && credentialStore === "memory" ) {
9393 return makeUnavailableUsageLimits ( {
9494 checkedAt,
You can’t perform that action at this time.
0 commit comments