( readonly context: vscode.ExtensionContext, private readonly outputChannel: vscode.OutputChannel, private readonly renderContext: "sidebar" | "editor" = "sidebar", public readonly contextProxy: ContextProxy, mdmService?: MdmService, )
| 210 | public readonly customModesManager: CustomModesManager |
| 211 | |
| 212 | constructor( |
| 213 | readonly context: vscode.ExtensionContext, |
| 214 | private readonly outputChannel: vscode.OutputChannel, |
| 215 | private readonly renderContext: "sidebar" | "editor" = "sidebar", |
| 216 | public readonly contextProxy: ContextProxy, |
| 217 | mdmService?: MdmService, |
| 218 | ) { |
| 219 | super() |
| 220 | this.currentWorkspacePath = getWorkspacePath() |
| 221 | this.pendingEditOperations = new PendingEditOperationStore( |
| 222 | ClineProvider.PENDING_OPERATION_TIMEOUT_MS, |
| 223 | (message) => this.log(message), |
| 224 | ) |
| 225 | |
| 226 | ClineProvider.activeInstances.add(this) |
| 227 | |
| 228 | this.mdmService = mdmService |
| 229 | this.updateGlobalState("codebaseIndexModels", EMBEDDING_MODEL_PROFILES) |
| 230 | |
| 231 | // Initialize the per-task file-based history store. |
| 232 | // The globalState write-through is debounced separately (not on every mutation) |
| 233 | // since per-task files are authoritative and globalState is only for downgrade compat. |
| 234 | this.taskHistoryStore = new TaskHistoryStore(this.contextProxy.globalStorageUri.fsPath, { |
| 235 | onWrite: async () => { |
| 236 | this.scheduleGlobalStateWriteThrough() |
| 237 | }, |
| 238 | }) |
| 239 | this.initializeTaskHistoryStore().catch((error) => { |
| 240 | this.log(`Failed to initialize TaskHistoryStore: ${error}`) |
| 241 | }) |
| 242 | |
| 243 | // Start configuration loading (which might trigger indexing) in the background. |
| 244 | // Don't await, allowing activation to continue immediately. |
| 245 | |
| 246 | // Register this provider with the telemetry service to enable it to add |
| 247 | // properties like mode and provider. |
| 248 | TelemetryService.instance.setProvider(this) |
| 249 | |
| 250 | this._workspaceTracker = new WorkspaceTracker(this) |
| 251 | |
| 252 | this.providerSettingsManager = new ProviderSettingsManager(this.context) |
| 253 | |
| 254 | this.customModesManager = new CustomModesManager(this.context, async () => { |
| 255 | await this.postStateToWebviewWithoutClineMessages() |
| 256 | }) |
| 257 | |
| 258 | // Initialize MCP Hub through the singleton manager |
| 259 | McpServerManager.getInstance(this.context, this) |
| 260 | .then((hub) => { |
| 261 | this.mcpHub = hub |
| 262 | this.mcpHub.registerClient() |
| 263 | }) |
| 264 | .catch((error) => { |
| 265 | this.log(`Failed to initialize MCP Hub: ${error}`) |
| 266 | }) |
| 267 | |
| 268 | // Initialize Skills Manager for skill discovery |
| 269 | this.skillsManager = new SkillsManager(this) |
nothing calls this directly
no test coverage detected