Rewrite the user-facing persistent sandbox story around pyro workspace ..., including the install guide, first-run transcript, integrations notes, and public contract reference. Rename the Python example to examples/python_workspace.py and update the docs to use the new workspace create, sync, exec, status, logs, and delete flows with seed_path/workspace_id terminology. Mark the 2.4.0 workspace-contract pivot as done in the roadmap now that the shipped CLI, SDK, MCP, docs, and tests all use the workspace-first surface.
5.6 KiB
5.6 KiB
Public Contract
This document defines the supported public interface for pyro-mcp 2.x.
Package Identity
- Distribution name:
pyro-mcp - Public executable:
pyro - Public Python import:
from pyro_mcp import Pyro - Public package-level factory:
from pyro_mcp import create_server
CLI Contract
Top-level commands:
pyro env listpyro env pullpyro env inspectpyro env prunepyro mcp servepyro runpyro workspace createpyro workspace sync pushpyro workspace execpyro workspace statuspyro workspace logspyro workspace deletepyro doctorpyro demopyro demo ollama
Stable pyro run interface:
- positional environment name
--vcpu-count--mem-mib--timeout-seconds--ttl-seconds--network--allow-host-compat--json
Behavioral guarantees:
pyro run <environment> -- <command>defaults to1 vCPU / 1024 MiB.pyro runfails if guest boot or guest exec is unavailable unless--allow-host-compatis set.pyro run,pyro env list,pyro env pull,pyro env inspect,pyro env prune, andpyro doctorare human-readable by default and return structured JSON with--json.pyro demo ollamaprints log lines plus a final summary line.pyro workspace createauto-starts a persistent workspace.pyro workspace create --seed-path PATHseeds/workspacefrom a host directory or a local.tar/.tar.gz/.tgzarchive before the workspace is returned.pyro workspace sync push WORKSPACE_ID SOURCE_PATH [--dest WORKSPACE_PATH]imports later host-side directory or archive content into a started workspace.pyro workspace execruns in the persistent/workspacefor that workspace and does not auto-clean.pyro workspace logsreturns persisted command history for that workspace untilpyro workspace delete.- Workspace create/status results expose
workspace_seedmetadata describing how/workspacewas initialized.
Python SDK Contract
Primary facade:
Pyro
Supported public entrypoints:
create_server()Pyro.create_server()Pyro.list_environments()Pyro.pull_environment(environment)Pyro.inspect_environment(environment)Pyro.prune_environments()Pyro.create_vm(...)Pyro.create_workspace(...)Pyro.push_workspace_sync(workspace_id, source_path, *, dest="/workspace")Pyro.start_vm(vm_id)Pyro.exec_vm(vm_id, *, command, timeout_seconds=30)Pyro.exec_workspace(workspace_id, *, command, timeout_seconds=30)Pyro.stop_vm(vm_id)Pyro.delete_vm(vm_id)Pyro.delete_workspace(workspace_id)Pyro.status_vm(vm_id)Pyro.status_workspace(workspace_id)Pyro.logs_workspace(workspace_id)Pyro.network_info_vm(vm_id)Pyro.reap_expired()Pyro.run_in_vm(...)
Stable public method names:
create_server()list_environments()pull_environment(environment)inspect_environment(environment)prune_environments()create_vm(...)create_workspace(...)push_workspace_sync(workspace_id, source_path, *, dest="/workspace")start_vm(vm_id)exec_vm(vm_id, *, command, timeout_seconds=30)exec_workspace(workspace_id, *, command, timeout_seconds=30)stop_vm(vm_id)delete_vm(vm_id)delete_workspace(workspace_id)status_vm(vm_id)status_workspace(workspace_id)logs_workspace(workspace_id)network_info_vm(vm_id)reap_expired()run_in_vm(...)
Behavioral defaults:
Pyro.create_vm(...)andPyro.run_in_vm(...)default tovcpu_count=1andmem_mib=1024.Pyro.create_workspace(...)defaults tovcpu_count=1andmem_mib=1024.allow_host_compatdefaults toFalseoncreate_vm(...)andrun_in_vm(...).allow_host_compatdefaults toFalseoncreate_workspace(...).Pyro.create_workspace(..., seed_path=...)seeds/workspacefrom a host directory or a local.tar/.tar.gz/.tgzarchive before the workspace is returned.Pyro.push_workspace_sync(...)imports later host-side directory or archive content into a started workspace.Pyro.exec_vm(...)runs one command and auto-cleans that VM after the exec completes.Pyro.exec_workspace(...)runs one command in the persistent workspace and leaves it alive.
MCP Contract
Primary tool:
vm_run
Advanced lifecycle tools:
vm_list_environmentsvm_createvm_startvm_execvm_stopvm_deletevm_statusvm_network_infovm_reap_expired
Persistent workspace tools:
workspace_createworkspace_sync_pushworkspace_execworkspace_statusworkspace_logsworkspace_delete
Behavioral defaults:
vm_runandvm_createdefault tovcpu_count=1andmem_mib=1024.workspace_createdefaults tovcpu_count=1andmem_mib=1024.vm_runandvm_createexposeallow_host_compat, which defaults tofalse.workspace_createexposesallow_host_compat, which defaults tofalse.workspace_createaccepts optionalseed_pathand seeds/workspacefrom a host directory or a local.tar/.tar.gz/.tgzarchive before the workspace is returned.workspace_sync_pushimports later host-side directory or archive content into a started workspace, with an optionaldestunder/workspace.vm_execruns one command and auto-cleans that VM after the exec completes.workspace_execruns one command in a persistent/workspaceand leaves the workspace alive.
Versioning Rule
pyro-mcpuses SemVer.- Environment names are stable identifiers in the shipped catalog.
- Changing a public command name, public flag, public method name, public MCP tool name, or required request field is a breaking change.