Tasks could start from host content in 2.2.0, but there was still no post-create path to update a live workspace from the host. This change adds the next host-to-task step so repeated fix or review loops do not require recreating the task for every local change. Add task sync push across the CLI, Python SDK, and MCP server, reusing the existing safe archive import path from seeded task creation instead of introducing a second transfer stack. The implementation keeps sync separate from workspace_seed metadata, validates destinations under /workspace, and documents the current non-atomic recovery path as delete-and-recreate. Validation: - uv lock - UV_CACHE_DIR=.uv-cache uv run pytest --no-cov tests/test_cli.py tests/test_vm_manager.py tests/test_api.py tests/test_server.py tests/test_public_contract.py - UV_CACHE_DIR=.uv-cache make check - UV_CACHE_DIR=.uv-cache make dist-check - real guest-backed smoke: task create --source-path, task sync push, task exec to verify both files, task delete
70 lines
1.5 KiB
Python
70 lines
1.5 KiB
Python
"""Public contract constants for the CLI, SDK, and MCP server."""
|
|
|
|
from __future__ import annotations
|
|
|
|
PUBLIC_CLI_COMMANDS = ("demo", "doctor", "env", "mcp", "run", "task")
|
|
PUBLIC_CLI_DEMO_SUBCOMMANDS = ("ollama",)
|
|
PUBLIC_CLI_ENV_SUBCOMMANDS = ("inspect", "list", "pull", "prune")
|
|
PUBLIC_CLI_TASK_SUBCOMMANDS = ("create", "delete", "exec", "logs", "status", "sync")
|
|
PUBLIC_CLI_TASK_SYNC_SUBCOMMANDS = ("push",)
|
|
PUBLIC_CLI_TASK_CREATE_FLAGS = (
|
|
"--vcpu-count",
|
|
"--mem-mib",
|
|
"--ttl-seconds",
|
|
"--network",
|
|
"--allow-host-compat",
|
|
"--source-path",
|
|
"--json",
|
|
)
|
|
PUBLIC_CLI_TASK_SYNC_PUSH_FLAGS = ("--dest", "--json")
|
|
PUBLIC_CLI_RUN_FLAGS = (
|
|
"--vcpu-count",
|
|
"--mem-mib",
|
|
"--timeout-seconds",
|
|
"--ttl-seconds",
|
|
"--network",
|
|
"--allow-host-compat",
|
|
"--json",
|
|
)
|
|
|
|
PUBLIC_SDK_METHODS = (
|
|
"create_server",
|
|
"create_task",
|
|
"create_vm",
|
|
"delete_task",
|
|
"delete_vm",
|
|
"exec_task",
|
|
"exec_vm",
|
|
"inspect_environment",
|
|
"list_environments",
|
|
"logs_task",
|
|
"network_info_vm",
|
|
"prune_environments",
|
|
"pull_environment",
|
|
"push_task_sync",
|
|
"reap_expired",
|
|
"run_in_vm",
|
|
"start_vm",
|
|
"status_task",
|
|
"status_vm",
|
|
"stop_vm",
|
|
)
|
|
|
|
PUBLIC_MCP_TOOLS = (
|
|
"vm_create",
|
|
"vm_delete",
|
|
"vm_exec",
|
|
"vm_list_environments",
|
|
"vm_network_info",
|
|
"vm_reap_expired",
|
|
"vm_run",
|
|
"vm_start",
|
|
"vm_status",
|
|
"vm_stop",
|
|
"task_create",
|
|
"task_delete",
|
|
"task_exec",
|
|
"task_logs",
|
|
"task_status",
|
|
"task_sync_push",
|
|
)
|