from __future__ import annotations import tempfile from pathlib import Path from pyro_mcp import Pyro def main() -> None: pyro = Pyro() with ( tempfile.TemporaryDirectory(prefix="pyro-task-seed-") as seed_dir, tempfile.TemporaryDirectory(prefix="pyro-task-sync-") as sync_dir, ): Path(seed_dir, "note.txt").write_text("hello from seed\n", encoding="utf-8") Path(sync_dir, "note.txt").write_text("hello from sync\n", encoding="utf-8") created = pyro.create_task(environment="debian:12", source_path=seed_dir) task_id = str(created["task_id"]) try: pyro.push_task_sync(task_id, sync_dir) result = pyro.exec_task(task_id, command="cat note.txt") print(result["stdout"], end="") logs = pyro.logs_task(task_id) print(f"task_id={task_id} command_count={logs['count']}") finally: pyro.delete_task(task_id) if __name__ == "__main__": main()