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:
Eyal Toledano
2025-12-18 14:11:40 -05:00
committed by GitHub
parent 4d1ed20345
commit 38c2c08af1
14 changed files with 447 additions and 28 deletions

View File

@@ -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 ==========
/**