Add MCP tool profiles for workspace chat flows
Expose stable MCP/server tool profiles so chat hosts can start narrow and widen only when needed. This adds vm-run, workspace-core, and workspace-full across the CLI serve path, Pyro.create_server(), and the package-level create_server() factory while keeping workspace-full as the default. Register profile-specific tool sets from one shared contract mapping, and narrow the workspace-core schemas so secrets, network policy, shells, services, snapshots, and disk tools do not leak into the default persistent chat profile. The full surface remains available unchanged under workspace-full. Refresh the public docs and examples around the profile progression, add a canonical OpenAI Responses workspace-core example, mark the 3.4.0 roadmap milestone done, and verify with uv lock, UV_CACHE_DIR=.uv-cache make check, UV_CACHE_DIR=.uv-cache make dist-check, and a real guest-backed workspace-core smoke for create, file write, exec, diff, export, reset, and delete.
This commit is contained in:
parent
446f7fce04
commit
eecfd7a7d7
23 changed files with 984 additions and 511 deletions
|
|
@ -63,6 +63,10 @@ def test_cli_subcommand_help_includes_examples_and_guidance() -> None:
|
|||
|
||||
mcp_help = _subparser_choice(_subparser_choice(parser, "mcp"), "serve").format_help()
|
||||
assert "Expose pyro tools over stdio for an MCP client." in mcp_help
|
||||
assert "--profile" in mcp_help
|
||||
assert "workspace-core" in mcp_help
|
||||
assert "workspace-full" in mcp_help
|
||||
assert "vm-run" in mcp_help
|
||||
assert "Use this from an MCP client config after the CLI evaluation path works." in mcp_help
|
||||
|
||||
workspace_help = _subparser_choice(parser, "workspace").format_help()
|
||||
|
|
@ -3435,7 +3439,8 @@ def test_cli_mcp_runs_stdio_transport(monkeypatch: pytest.MonkeyPatch) -> None:
|
|||
observed: dict[str, str] = {}
|
||||
|
||||
class StubPyro:
|
||||
def create_server(self) -> Any:
|
||||
def create_server(self, *, profile: str) -> Any:
|
||||
observed["profile"] = profile
|
||||
return type(
|
||||
"StubServer",
|
||||
(),
|
||||
|
|
@ -3444,12 +3449,12 @@ def test_cli_mcp_runs_stdio_transport(monkeypatch: pytest.MonkeyPatch) -> None:
|
|||
|
||||
class StubParser:
|
||||
def parse_args(self) -> argparse.Namespace:
|
||||
return argparse.Namespace(command="mcp", mcp_command="serve")
|
||||
return argparse.Namespace(command="mcp", mcp_command="serve", profile="workspace-core")
|
||||
|
||||
monkeypatch.setattr(cli, "_build_parser", lambda: StubParser())
|
||||
monkeypatch.setattr(cli, "Pyro", StubPyro)
|
||||
cli.main()
|
||||
assert observed == {"transport": "stdio"}
|
||||
assert observed == {"profile": "workspace-core", "transport": "stdio"}
|
||||
|
||||
|
||||
def test_cli_demo_default_prints_json(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue