@@ -21,7 +21,7 @@ import { TelemetryEventName } from "@roo-code/types"
2121 * to this provider instead of the ServiceFactory → orchestrator pipeline.
2222 */
2323export class SembleProvider implements ISembleProvider {
24- private cli : SembleCLI
24+ private cli ! : SembleCLI
2525 private readonly workspacePath : string
2626 private readonly config : SembleConfig
2727 private readonly stateManager : CodeIndexStateManager
@@ -34,28 +34,24 @@ export class SembleProvider implements ISembleProvider {
3434 workspacePath : string ,
3535 context : vscode . ExtensionContext ,
3636 stateManager : CodeIndexStateManager ,
37- semblePath : string = SEMBLE_DEFAULTS . DEFAULT_PATH ,
3837 options ?: { topK ?: number ; content ?: SembleContentType } ,
3938 ) {
4039 this . workspacePath = workspacePath
4140 this . context = context
4241 this . stateManager = stateManager
4342
4443 this . config = {
45- semblePath,
4644 topK : options ?. topK ?? SEMBLE_DEFAULTS . DEFAULT_TOP_K ,
4745 content : options ?. content ?? SEMBLE_DEFAULTS . DEFAULT_CONTENT ,
4846 }
49-
50- this . cli = new SembleCLI ( semblePath )
5147 }
5248
5349 get state ( ) : IndexingState {
5450 return this . _state
5551 }
5652
5753 /**
58- * Initializes the provider: downloads semble if needed , then validates it works.
54+ * Initializes the provider: downloads semble, then validates it works.
5955 */
6056 async initialize ( ) : Promise < void > {
6157 if ( this . _isInitialized ) {
@@ -73,21 +69,20 @@ export class SembleProvider implements ISembleProvider {
7369 return
7470 }
7571
76- // Auto-download semble if no custom path is configured
77- if ( this . config . semblePath === SEMBLE_DEFAULTS . DEFAULT_PATH ) {
78- try {
79- this . stateManager . setSystemState ( "Indexing" , "Downloading semble binary..." )
80- const storageDir = this . context . globalStorageUri . fsPath
81- const binaryPath = await downloadSemble ( storageDir )
82- if ( binaryPath ) {
83- this . cli = new SembleCLI ( binaryPath )
84- }
85- } catch ( error : any ) {
86- this . _state = "Error"
87- this . stateManager . setSystemState ( "Error" , `Failed to download semble: ${ error ?. message || error } ` )
88- console . error ( "[SembleProvider] Download failed:" , error ?. message || error )
89- return
72+ // Download semble binary
73+ try {
74+ this . stateManager . setSystemState ( "Indexing" , "Downloading semble binary..." )
75+ const storageDir = this . context . globalStorageUri . fsPath
76+ const binaryPath = await downloadSemble ( storageDir )
77+ if ( ! binaryPath ) {
78+ throw new Error ( "Download returned no path" )
9079 }
80+ this . cli = new SembleCLI ( binaryPath )
81+ } catch ( error : any ) {
82+ this . _state = "Error"
83+ this . stateManager . setSystemState ( "Error" , `Failed to download semble: ${ error ?. message || error } ` )
84+ console . error ( "[SembleProvider] Download failed:" , error ?. message || error )
85+ return
9186 }
9287
9388 // Verify the binary works
0 commit comments