mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
feat(cli): add --watch flag to list command for real-time updates (#1526)
Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Fixes #1526 PR review comments from CodeRabbit and changeset-bot
This commit is contained in:
@@ -36,6 +36,11 @@ import type {
|
||||
} from './services/preflight-checker.service.js';
|
||||
import type { TaskValidationResult } from './services/task-loader.service.js';
|
||||
import type { ExpandTaskResult } from '../integration/services/task-expansion.service.js';
|
||||
import type {
|
||||
WatchEvent,
|
||||
WatchOptions,
|
||||
WatchSubscription
|
||||
} from '../../common/interfaces/storage.interface.js';
|
||||
|
||||
/**
|
||||
* Tasks Domain - Unified API for all task operations
|
||||
@@ -389,6 +394,25 @@ export class TasksDomain {
|
||||
return this.taskService.getStorageType();
|
||||
}
|
||||
|
||||
// ========== Watch ==========
|
||||
|
||||
/**
|
||||
* Watch for changes to tasks
|
||||
* For file storage: uses fs.watch on tasks.json with debouncing
|
||||
* For API storage: uses Supabase Realtime subscriptions
|
||||
*
|
||||
* @param callback - Function called when tasks change
|
||||
* @param options - Watch options (debounce, tag)
|
||||
* @returns Subscription handle with unsubscribe method
|
||||
*/
|
||||
async watch(
|
||||
callback: (event: WatchEvent) => void,
|
||||
options?: WatchOptions
|
||||
): Promise<WatchSubscription> {
|
||||
const storage = this.taskService.getStorage();
|
||||
return storage.watch(callback, options);
|
||||
}
|
||||
|
||||
// ========== Task File Generation ==========
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user