| 152 | } |
| 153 | |
| 154 | export class ClineProvider |
| 155 | extends EventEmitter<TaskProviderEvents> |
| 156 | implements vscode.WebviewViewProvider, TelemetryPropertiesProvider, TaskProviderLike |
| 157 | { |
| 158 | // Used in package.json as the view's id. This value cannot be changed due |
| 159 | // to how VSCode caches views based on their id, and updating the id would |
| 160 | // break existing instances of the extension. |
| 161 | public static readonly sideBarId = `${Package.name}.SidebarProvider` |
| 162 | public static readonly tabPanelId = `${Package.name}.TabPanelProvider` |
| 163 | private static activeInstances: Set<ClineProvider> = new Set() |
| 164 | private disposables: vscode.Disposable[] = [] |
| 165 | private webviewDisposables: vscode.Disposable[] = [] |
| 166 | private view?: vscode.WebviewView | vscode.WebviewPanel |
| 167 | private clineStack: Task[] = [] |
| 168 | private delegationTransitionLocks?: Map<string, Promise<void>> |
| 169 | private cancelledDelegationChildIds = new Set<string>() |
| 170 | private codeIndexStatusSubscription?: vscode.Disposable |
| 171 | private codeIndexManager?: CodeIndexManager |
| 172 | private _workspaceTracker?: WorkspaceTracker // workSpaceTracker read-only for access outside this class |
| 173 | protected mcpHub?: McpHub // Change from private to protected |
| 174 | protected skillsManager?: SkillsManager |
| 175 | private marketplaceManager: MarketplaceManager |
| 176 | private mdmService?: MdmService |
| 177 | private taskCreationCallback: (task: Task) => void |
| 178 | private taskEventListeners: WeakMap<Task, Array<() => void>> = new WeakMap() |
| 179 | private currentWorkspacePath: string | undefined |
| 180 | private _disposed = false |
| 181 | private readonly rateLimitClock: RateLimitClock = createRateLimitClock() |
| 182 | |
| 183 | private recentTasksCache?: string[] |
| 184 | public readonly taskHistoryStore: TaskHistoryStore |
| 185 | private taskHistoryStoreInitialized = false |
| 186 | private globalStateWriteThroughTimer: ReturnType<typeof setTimeout> | null = null |
| 187 | private static readonly GLOBAL_STATE_WRITE_THROUGH_DEBOUNCE_MS = 5000 // 5 seconds |
| 188 | private static readonly PENDING_OPERATION_TIMEOUT_MS = 30000 // 30 seconds |
| 189 | |
| 190 | private runDelegationTransition<T>(parentTaskId: string, fn: () => Promise<T>): Promise<T> { |
| 191 | this.delegationTransitionLocks ??= new Map() |
| 192 | return runDelegationTransition(this.delegationTransitionLocks, parentTaskId, fn) |
| 193 | } |
| 194 | private readonly pendingEditOperations: PendingEditOperationStore |
| 195 | |
| 196 | private cloudOrganizationsCache: CloudOrganizationMembership[] | null = null |
| 197 | private cloudOrganizationsCacheTimestamp: number | null = null |
| 198 | private static readonly CLOUD_ORGANIZATIONS_CACHE_DURATION_MS = 5 * 1000 // 5 seconds |
| 199 | |
| 200 | /** |
| 201 | * Monotonically increasing sequence number for clineMessages state pushes. |
| 202 | * Used by the frontend to reject stale state that arrives out-of-order. |
| 203 | */ |
| 204 | private clineMessagesSeq = 0 |
| 205 | |
| 206 | public isViewLaunched = false |
| 207 | public settingsImportedAt?: number |
| 208 | public readonly latestAnnouncementId = "jul-2026-v3.66.0-claude-sonnet-5-semble-task-lifecycle" // v3.66.0 Claude Sonnet 5 support, Semble v0.4.1 upgrade, task-lifecycle status transition guard |
| 209 | public readonly providerSettingsManager: ProviderSettingsManager |
| 210 | public readonly customModesManager: CustomModesManager |
| 211 |
nothing calls this directly
no test coverage detected