11import axios from "axios"
22import * as yaml from "yaml"
33import { z } from "zod"
4- import { getKiloBaseUriFromToken } from "@roo-code/types" // kilocode_change
4+ import { getKiloUrl } from "../../shared/kilocode/url"
55import {
66 type MarketplaceItem ,
77 type MarketplaceItemType ,
@@ -19,13 +19,10 @@ const mcpMarketplaceResponse = z.object({
1919} )
2020
2121export class RemoteConfigLoader {
22- private apiBaseUrl : string
2322 private cache : Map < string , { data : MarketplaceItem [ ] ; timestamp : number } > = new Map ( )
2423 private cacheDuration = 5 * 60 * 1000 // 5 minutes
2524
26- constructor ( ) {
27- this . apiBaseUrl = getKiloBaseUriFromToken ( )
28- }
25+ constructor ( ) { }
2926
3027 async loadAllItems ( hideMarketplaceMcps = false ) : Promise < MarketplaceItem [ ] > {
3128 const items : MarketplaceItem [ ] = [ ]
@@ -47,7 +44,8 @@ export class RemoteConfigLoader {
4744 return cached
4845 }
4946
50- const data = await this . fetchWithRetry < string > ( `${ this . apiBaseUrl } /api/marketplace/modes` )
47+ const url = getKiloUrl ( "https://kilocode.ai/api/marketplace/modes" )
48+ const data = await this . fetchWithRetry < string > ( url )
5149
5250 const yamlData = yaml . parse ( data )
5351 const validated = modeMarketplaceResponse . parse ( yamlData )
@@ -69,7 +67,8 @@ export class RemoteConfigLoader {
6967 return cached
7068 }
7169
72- const data = await this . fetchWithRetry < string > ( `${ this . apiBaseUrl } /api/marketplace/mcps` )
70+ const url = getKiloUrl ( "https://kilocode.ai/api/marketplace/mcps" )
71+ const data = await this . fetchWithRetry < string > ( url )
7372
7473 const yamlData = yaml . parse ( data )
7574 const validated = mcpMarketplaceResponse . parse ( yamlData )
0 commit comments