feat: Add _add_all_targets method to CLI
Enables adding all windows from a session at once to the orchestrator monitoring. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -277,6 +277,32 @@ class ClaudeCLI:
|
||||
self.save_targets(targets)
|
||||
self.print_success(f"Added target: {session}:{window}")
|
||||
|
||||
def _add_all_targets(self, session: str):
|
||||
windows = self.tmux.list_windows(session)
|
||||
if not windows:
|
||||
self.print_warning(f"No windows found in session {session}")
|
||||
return False
|
||||
|
||||
targets = self.load_targets()
|
||||
if session not in targets['targets']:
|
||||
targets['targets'][session] = []
|
||||
|
||||
added = []
|
||||
for window in windows:
|
||||
win_idx = window['index']
|
||||
if win_idx not in targets['targets'][session]:
|
||||
targets['targets'][session].append(win_idx)
|
||||
added.append(win_idx)
|
||||
|
||||
if added:
|
||||
targets['targets'][session].sort()
|
||||
self.save_targets(targets)
|
||||
self.print_success(f"Added targets: {session}:{added}")
|
||||
return True
|
||||
else:
|
||||
self.print_info(f"All windows in {session} already monitored")
|
||||
return True
|
||||
|
||||
def _remove_target(self, session: str, window: int) -> bool:
|
||||
targets = self.load_targets()
|
||||
if session in targets['targets'] and window in targets['targets'][session]:
|
||||
|
||||
Reference in New Issue
Block a user