export class SubscriptionManager { private readonly uris = new Set(); subscribe(uri: string): void { this.uris.add(uri); } unsubscribe(uri: string): void { this.uris.delete(uri); } isSubscribed(uri: string): boolean { return this.uris.has(uri); } getSubscribed(): string[] { return [...this.uris]; } getMatchingSubscriptions(taskId: string): string[] { const matches: string[] = []; for (const uri of this.uris) { if (uri === 'task:///all') { matches.push(uri); } else if (uri === `task:///${taskId}` || uri.startsWith(`task:///${taskId}/`)) { matches.push(uri); } } return matches; } }