Open the peer CLI inside Codey's terminal via a PTY, auto-type the prompt, let the user interact freely, capture everything it outputs. Returns the full captured output as a string.
(self, cli: PeerCLI, prompt: str)
| 248 | return "redirect", ans |
| 249 | |
| 250 | def call(self, cli: PeerCLI, prompt: str) -> str: |
| 251 | """ |
| 252 | Open the peer CLI inside Codey's terminal via a PTY, auto-type the |
| 253 | prompt, let the user interact freely, capture everything it outputs. |
| 254 | Returns the full captured output as a string. |
| 255 | """ |
| 256 | from core.peer_shell import run_peer, run_direct, run_prompted |
| 257 | if cli.prompt_flag and prompt: |
| 258 | # Non-interactive: cmd -p "task" — clean output, no TUI |
| 259 | return run_prompted(cli.name, cli.cmd, cli.prompt_flag, prompt) |
| 260 | elif cli.use_pty: |
| 261 | return run_peer(cli.name, cli.cmd, prompt) |
| 262 | else: |
| 263 | return run_direct(cli.name, cli.cmd, prompt) |
| 264 | |
| 265 | @staticmethod |
| 266 | def is_peer_error(output: str) -> bool: |
no test coverage detected