mcpforunityserver 8.7.1__py3-none-any.whl → 9.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- main.py +4 -3
- {mcpforunityserver-8.7.1.dist-info → mcpforunityserver-9.0.1.dist-info}/METADATA +2 -2
- mcpforunityserver-9.0.1.dist-info/RECORD +72 -0
- {mcpforunityserver-8.7.1.dist-info → mcpforunityserver-9.0.1.dist-info}/top_level.txt +0 -1
- services/custom_tool_service.py +13 -8
- services/resources/active_tool.py +1 -1
- services/resources/custom_tools.py +2 -2
- services/resources/editor_state.py +283 -30
- services/resources/gameobject.py +243 -0
- services/resources/layers.py +1 -1
- services/resources/prefab_stage.py +1 -1
- services/resources/project_info.py +1 -1
- services/resources/selection.py +1 -1
- services/resources/tags.py +1 -1
- services/resources/unity_instances.py +1 -1
- services/resources/windows.py +1 -1
- services/state/external_changes_scanner.py +3 -4
- services/tools/batch_execute.py +24 -9
- services/tools/debug_request_context.py +8 -2
- services/tools/execute_custom_tool.py +6 -1
- services/tools/execute_menu_item.py +6 -3
- services/tools/find_gameobjects.py +89 -0
- services/tools/find_in_file.py +26 -19
- services/tools/manage_asset.py +13 -44
- services/tools/manage_components.py +131 -0
- services/tools/manage_editor.py +9 -8
- services/tools/manage_gameobject.py +115 -79
- services/tools/manage_material.py +80 -31
- services/tools/manage_prefabs.py +7 -1
- services/tools/manage_scene.py +30 -13
- services/tools/manage_script.py +62 -19
- services/tools/manage_scriptable_object.py +22 -10
- services/tools/manage_shader.py +8 -1
- services/tools/manage_vfx.py +738 -0
- services/tools/preflight.py +15 -12
- services/tools/read_console.py +11 -4
- services/tools/refresh_unity.py +24 -14
- services/tools/run_tests.py +162 -53
- services/tools/script_apply_edits.py +15 -7
- services/tools/set_active_instance.py +12 -7
- services/tools/utils.py +60 -6
- transport/legacy/port_discovery.py +2 -2
- transport/legacy/unity_connection.py +1 -1
- transport/plugin_hub.py +24 -16
- transport/unity_instance_middleware.py +4 -3
- transport/unity_transport.py +2 -1
- mcpforunityserver-8.7.1.dist-info/RECORD +0 -71
- routes/__init__.py +0 -0
- services/resources/editor_state_v2.py +0 -270
- services/tools/test_jobs.py +0 -94
- {mcpforunityserver-8.7.1.dist-info → mcpforunityserver-9.0.1.dist-info}/WHEEL +0 -0
- {mcpforunityserver-8.7.1.dist-info → mcpforunityserver-9.0.1.dist-info}/entry_points.txt +0 -0
- {mcpforunityserver-8.7.1.dist-info → mcpforunityserver-9.0.1.dist-info}/licenses/LICENSE +0 -0
services/tools/test_jobs.py
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"""Async Unity Test Runner jobs: start + poll."""
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
|
|
4
|
-
from typing import Annotated, Any, Literal
|
|
5
|
-
|
|
6
|
-
from fastmcp import Context
|
|
7
|
-
|
|
8
|
-
from models import MCPResponse
|
|
9
|
-
from services.registry import mcp_for_unity_tool
|
|
10
|
-
from services.tools import get_unity_instance_from_context
|
|
11
|
-
from services.tools.preflight import preflight
|
|
12
|
-
import transport.unity_transport as unity_transport
|
|
13
|
-
from transport.legacy.unity_connection import async_send_command_with_retry
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@mcp_for_unity_tool(description="Starts a Unity test run asynchronously and returns a job_id immediately. Preferred over run_tests for long-running suites. Poll with get_test_job for progress.")
|
|
17
|
-
async def run_tests_async(
|
|
18
|
-
ctx: Context,
|
|
19
|
-
mode: Annotated[Literal["EditMode", "PlayMode"], "Unity test mode to run"] = "EditMode",
|
|
20
|
-
test_names: Annotated[list[str] | str, "Full names of specific tests to run"] | None = None,
|
|
21
|
-
group_names: Annotated[list[str] | str, "Same as test_names, except it allows for Regex"] | None = None,
|
|
22
|
-
category_names: Annotated[list[str] | str, "NUnit category names to filter by"] | None = None,
|
|
23
|
-
assembly_names: Annotated[list[str] | str, "Assembly names to filter tests by"] | None = None,
|
|
24
|
-
include_failed_tests: Annotated[bool, "Include details for failed/skipped tests only (default: false)"] = False,
|
|
25
|
-
include_details: Annotated[bool, "Include details for all tests (default: false)"] = False,
|
|
26
|
-
) -> dict[str, Any] | MCPResponse:
|
|
27
|
-
unity_instance = get_unity_instance_from_context(ctx)
|
|
28
|
-
|
|
29
|
-
gate = await preflight(ctx, requires_no_tests=True, wait_for_no_compile=True, refresh_if_dirty=True)
|
|
30
|
-
if isinstance(gate, MCPResponse):
|
|
31
|
-
return gate
|
|
32
|
-
|
|
33
|
-
def _coerce_string_list(value) -> list[str] | None:
|
|
34
|
-
if value is None:
|
|
35
|
-
return None
|
|
36
|
-
if isinstance(value, str):
|
|
37
|
-
return [value] if value.strip() else None
|
|
38
|
-
if isinstance(value, list):
|
|
39
|
-
result = [str(v).strip() for v in value if v and str(v).strip()]
|
|
40
|
-
return result if result else None
|
|
41
|
-
return None
|
|
42
|
-
|
|
43
|
-
params: dict[str, Any] = {"mode": mode}
|
|
44
|
-
if (t := _coerce_string_list(test_names)):
|
|
45
|
-
params["testNames"] = t
|
|
46
|
-
if (g := _coerce_string_list(group_names)):
|
|
47
|
-
params["groupNames"] = g
|
|
48
|
-
if (c := _coerce_string_list(category_names)):
|
|
49
|
-
params["categoryNames"] = c
|
|
50
|
-
if (a := _coerce_string_list(assembly_names)):
|
|
51
|
-
params["assemblyNames"] = a
|
|
52
|
-
if include_failed_tests:
|
|
53
|
-
params["includeFailedTests"] = True
|
|
54
|
-
if include_details:
|
|
55
|
-
params["includeDetails"] = True
|
|
56
|
-
|
|
57
|
-
response = await unity_transport.send_with_unity_instance(
|
|
58
|
-
async_send_command_with_retry,
|
|
59
|
-
unity_instance,
|
|
60
|
-
"run_tests_async",
|
|
61
|
-
params,
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
if isinstance(response, dict) and not response.get("success", True):
|
|
65
|
-
return MCPResponse(**response)
|
|
66
|
-
return response if isinstance(response, dict) else MCPResponse(success=False, error=str(response)).model_dump()
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@mcp_for_unity_tool(description="Polls an async Unity test job by job_id.")
|
|
70
|
-
async def get_test_job(
|
|
71
|
-
ctx: Context,
|
|
72
|
-
job_id: Annotated[str, "Job id returned by run_tests_async"],
|
|
73
|
-
include_failed_tests: Annotated[bool, "Include details for failed/skipped tests only (default: false)"] = False,
|
|
74
|
-
include_details: Annotated[bool, "Include details for all tests (default: false)"] = False,
|
|
75
|
-
) -> dict[str, Any] | MCPResponse:
|
|
76
|
-
unity_instance = get_unity_instance_from_context(ctx)
|
|
77
|
-
|
|
78
|
-
params: dict[str, Any] = {"job_id": job_id}
|
|
79
|
-
if include_failed_tests:
|
|
80
|
-
params["includeFailedTests"] = True
|
|
81
|
-
if include_details:
|
|
82
|
-
params["includeDetails"] = True
|
|
83
|
-
|
|
84
|
-
response = await unity_transport.send_with_unity_instance(
|
|
85
|
-
async_send_command_with_retry,
|
|
86
|
-
unity_instance,
|
|
87
|
-
"get_test_job",
|
|
88
|
-
params,
|
|
89
|
-
)
|
|
90
|
-
if isinstance(response, dict) and not response.get("success", True):
|
|
91
|
-
return MCPResponse(**response)
|
|
92
|
-
return response if isinstance(response, dict) else MCPResponse(success=False, error=str(response)).model_dump()
|
|
93
|
-
|
|
94
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|