MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / call

Method call

core/peer_cli.py:250–263  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Callers 3

handle_commandFunction · 0.80
escalateFunction · 0.80
run_agentFunction · 0.80

Calls 3

run_promptedFunction · 0.90
run_peerFunction · 0.90
run_directFunction · 0.90

Tested by

no test coverage detected