Start the first workspace milestone toward the task-oriented product without changing the existing one-shot vm_run/pyro run contract. Add a disk-backed task registry in the manager, auto-started task workspaces rooted at /workspace, repeated non-cleaning exec, and persisted command journals exposed through task create/exec/status/logs/delete across the CLI, Python SDK, and MCP server. Update the public contract, docs, examples, and version/catalog metadata for 2.1.0, and cover the new surface with manager, CLI, SDK, and MCP tests. Validation: UV_CACHE_DIR=.uv-cache make check and UV_CACHE_DIR=.uv-cache make dist-check.
21 lines
584 B
Python
21 lines
584 B
Python
from __future__ import annotations
|
|
|
|
from pyro_mcp import Pyro
|
|
|
|
|
|
def main() -> None:
|
|
pyro = Pyro()
|
|
created = pyro.create_task(environment="debian:12")
|
|
task_id = str(created["task_id"])
|
|
try:
|
|
pyro.exec_task(task_id, command="printf 'hello from task\\n' > note.txt")
|
|
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()
|