text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>""" Tests for the find_gameobjects tool. This tool provides paginated GameObject search, returning instance IDs only. """ import pytest from .test_helpers import DummyContext import services.tools.find_gameobjects as find_go_mod @pytest.mark.asyncio async def test_find_gameobjects_basic_search(monkeyp...
fim
CoplayDev/unity-mcp
python
""" Tests for the GameObject resources. Resources: - mcpforunity://scene/gameobject/{instance_id} - mcpforunity://scene/gameobject/{instance_id}/components - mcpforunity://scene/gameobject/{instance_id}/component/{component_name} """ import pytest from .test_helpers import DummyContext import services.resources.gameo...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ss": True, "data": {"sha256": "abc", "lengthBytes": 1, "lastModifiedUtc": "2020-01-01T00:00:00Z", "uri": "mcpforunity://path/Assets/Scripts/A.cs", "path": "Assets/Scripts/A.cs"}} # Patch the send_command_with_retry function at the module level where it's imported import transport.legacy.unity_con...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|> info(self, message): self.log_info.append(message) async def warning(self, message): self.log_warning.append(message) # Some code paths call warn(); treat it as an alias of warning() async def warn(self, message): await self.warning(message) async def error(self...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Test the improved anchor matching logic. """ import re import pytest import services.tools.script_apply_edits as script_apply_edits_module def test_improved_anchor_matching(): """Test that our improved anchor matching finds the right closing brace.""" test_code = '''using UnityEngine; p...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Tests for per-call unity_instance routing via middleware argument interception. When a tool call includes unity_instance in its arguments, the middleware: 1. Pops the key before Pydantic validation sees it 2. Resolves it to a validated instance identifier 3. Sets it in request-scoped state for ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest import sys import types from types import SimpleNamespace from .test_helpers import DummyContext from core.config import config class DummyMiddlewareContext: def __init__(self, ctx): self.fast<|fim_suffix|>ection = types.ModuleType("transport.legacy.unity_connection") unit...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>nce): # Inject state via middleware middleware_ctx = Mock() middleware_ctx.fastmcp_context = ctx async def mock_tool_call(middleware_ctx): # The middleware passes the middleware_ctx, we need the fastmcp_context tool_ctx = mid...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext @pytest.mark.<|fim_suffix|>ity_instance_middleware(middleware) ctx = DummyContext() await middleware.set_active_instance(ctx, "SessionProj@AAAA1111") assert await middleware.get_active_instance(ctx) == "SessionProj@AAAA1111" # Simul...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>test_invalid_json_string_handling(self): """Test that invalid JSON strings are handled gracefully.""" invalid_json = '{"invalid": json, "missing": quotes}' result, status = parse_properties_json(invalid_json) assert "failed to parse" in status assert result == inv...
fim
CoplayDev/unity-mcp
python
import ast from pathlib import Path import pytest # locate server src dynamically to avoid hardcoded layout assumptions ROOT = Path(__file__).resolve().parents[2] # tests/integration -> tests -> Server candidates = [ ROOT / "src", ] SRC = next((p for p in candidates if p.exists()), None) if SRC is None: sea...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ge_asset( ctx=ctx, action="create", path="Assets/Test.mat", asset_type="Material", properties=None ) # Verify no JSON parsing was attempted (allow initial Processing log) assert not any("coerced properties" in msg for msg...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import asyncio from .test_helpers import DummyContext import services.to<|fim_suffix|>anage_asset_mod, "async_send_command_with_retry", fake_async_send) result = asyncio.run( manage_asset_mod.manage_asset( ctx=DummyContext(), action="search", path="Assets"...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Tests for the manage_components tool. This tool handles component lifecycle operations (add, remove, set_property). """ import pytest from .test_helpers import DummyContext import services.tools.manage_components as manage_comp_mod @pytest.mark.asyncio async def test_manage_components_add_single(m...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>t that omitting is_static does not include isStatic in params.""" captured = {} async def fake_send(cmd, params, **kwargs): captured["params"] = params return {"success": True, "data": {}} monkeypatch.setattr( manage_go_mod, "async_send_command_with_retry", ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext import services.tools.manage_gameobject as manage_go_mod @pytest.mark.asyncio async def test_look_at_vector_target(monkeypatch): """look_at action forwards look_at_target as a vector.""" captured = {} async def fake_send(cmd, params, **k...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext import services.tools.manage_gameobject as manage_go_mod @pytest.mark.asyncio async def test_manage_gameobject_boolean_coercion(monkeypatch): """Test that string boolean values are properly coerced for valid actions.""" captured = {} asy...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>enPerNode"] in (200, "200") assert p["includeTransform"] in (True, "true") <|fim_prefix|>import pytest from .test_helpers import DummyContext import services.tools.manage_scene as manage_scene_mod @pytest.mark.asyncio async def test_manage_scene_get_hierarchy_paging_params_pass_through(monkeypatc...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|> assert captured['params']['path'] == 'Assets/Scripts' <|fim_prefix|>import pytest from .test_helpers import DummyContext, setup_script_tools @pytest.mark.asyncio async def test_split_uri_unity_path(monkeypatch): test_tools = setup_script_tools() captured = {} async def fake_send(cmd, ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext import services.tools.manage_scriptable_object as mod @pytest.mark.asyncio async def test_manage_scriptable_object_forwards_create_params(monkeypatch): captured = {} async def fake_async_send(cmd, params, **kwargs): captured["cmd"] =...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ert resp["success"] is False assert "pixels array must have 4 entries" in resp["message"] def test_texture_modify_invalid_set_pixels_type(self, monkeypatch): """Test error handling for invalid set_pixels input type.""" async def fake_send(*args, **kwargs): return {...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>"success": True, "message": "Created"} monkeypatch.setattr(manage_ui_mod, "send_mutation", fake_send) run_async(manage_ui_mod.manage_ui( ctx=DummyContext(), action="create", path="Assets/UI/Test.uxml", contents=SAMPLE_UXML, )) ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|> assert result["error"] == "auth_required" <|fim_prefix|>"""Tests for UnityInstanceMiddleware auth enforcement in remote-hosted mode.""" import asyncio import sys from unittest.mock import AsyncMock, Mock, patch import pytest from core.config import config from tests.integration.test_helpers impo...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>rojectBeta" @pytest.mark.asyncio async def test_get_sessions_no_filter_returns_all_in_local_mode(self): """In local mode, PluginHub.get_sessions() without user_id returns everything.""" await _setup_two_user_registry() all_sessions = await PluginHub.get_sessions() ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>_without_key(self, monkeypatch): """When not remote-hosted, WebSocket accepted without API key.""" monkeypatch.setattr(config, "http_remote_hosted", False) ws = _make_mock_websocket(headers={}) hub = _make_hub() await hub.on_connect(ws) ws.accept.assert_c...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>stry.list_sessions(user_id="userB") assert len(user_b_sessions) == 1 assert "s2" in user_b_sessions @pytest.mark.asyncio async def test_list_sessions_no_filter_returns_all_in_local_mode(self): """In local mode (not remote-hosted), list_sessions(user_id=None) returns all.""...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ypatch.setattr( services.tools.read_console, "async_send_command_with_retry", fake_send, ) resp = await read_console(ctx=DummyContext(), action="get", count=10, include_stacktrace=False) assert resp == {"success": True, "data": { "lines": [{"level": "error", "m...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>om .test_helpers import DummyContext # Tests for resource_tools.py have been removed since the file was deleted # These tests were confusing LLMs that read resources <|fim_prefix|>import <|fim_middle|>asyncio import pytest fr<|endoftext|>
fim
CoplayDev/unity-mcp
python
<|fim_suffix|> import services.tools.refresh_unity # noqa: F401 names = {t.get("name") for t in get_registered_tools()} assert "refresh_unity" in names <|fim_prefix|>from services.registry import get_registered_tools def test_refresh_unity_tool_is_registered(): """ <|fim_middle|>Red test: we expec...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>es[inst] = ExternalChangesState(dirty=True, dirty_since_unix_ms=1) async def fake_send_with_unity_instance(send_fn, unity_instance, command_type, params, **kwargs): if command_type == "refresh_unity": return {"success": False, "error": "disconnected", "hint": "retry"} elif...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>_headers = lambda include_all=False: {} # No x-api-key monkeypatch.setitem( sys.modules, "fastmcp.server.dependencies", deps_mod) from transport.unity_transport import _resolve_user_id_from_request result = await _resolve_user_id_from_request() assert result ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext @pytest.mark.asyncio async def test_run_tests_async_forwards_params(monkeypatch): from services.tools.run_tests import run_tests captured = {} async def fake_send_with_unity_instance(send_fn, unity_instance, command_type, params, **kwar...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>"""Tests for script_apply_edits.py local helper functions. Focuses on _apply_edits_locally, _find_best_closing_brace_match, and _is_in_string_context — especially around C# string variants (verbatim, interpolated, raw) that can fool brace/anchor matching. """ import re import pytest from services.tools....
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest import asyncio from .test_helpers import DummyContext, DummyMCP, setup_script_tools def setup_asset_tools(): """Setup asset-related tools for testing.""" mcp = DummyMCP() import services.tools.manage_asset from services.registry import get_registered_tools for tool_inf...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Tests for stdio-mode custom tool discovery (GitHub issue #837). Verifies that: 1. sync_tool_visibility_from_unity registers custom tools when extended metadata is present 2. Custom tools are skipped gracefully when metadata is missing (old Unity package) 3. Reconnection flag triggers a background re-...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import os import importlib import pytest def test_endpoint_rejects_non_http(tmp_path, monkeypatch): # Point data dir to temp to avoid touching real files monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path)) monkeypatch.setenv("UNITY_MCP_TELEMETRY_ENDPOINT", "file:///etc/passwd") # Import ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>r thread exists and is alive assert collector._worker.is_alive() worker_threads = [ t for t in threading.enumerate() if t is collector._worker] assert len(worker_threads) == 1 finally: if caplog.handler in tel_logger.handlers: tel_logger.removeHa...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import importlib def _get_decorator_module(): # Import the telemetry_decorator module from the MCP for Unity server src import sys import pathlib import types # Tests can now import directly from parent package # Remove any previously stubbed module to force real import sys.m...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import inspect # pyright: reportMissingImports=false def test_manage_scene_signature_includes_paging_params(): import services.tools.manage_scene as mod sig = inspect.signature(mod.manage_scene) names = list(sig.parameters.keys()) <|fim_suffix|> in names assert "page_size" in names ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>from transport.legacy.unity_connection import UnityConnection import sys import json import struct import socket import threading import time import select from pathlib import Path import pytest # locate server src dynamically to avoid hardcoded layout assumptions ROOT = Path(__file__).resolve().parents...
fim
CoplayDev/unity-mcp
python
"""End-to-end-ish smoke tests for transport routing paths.""" from __future__ import annotations import pytest from core.config import config from transport import unity_transport @pytest.mark.asyncio async def test_http_local_smoke(monkeypatch): """HTTP local should route through PluginHub without requiring us...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from .test_helpers import DummyContext, setup_script_tools @pytest.mark.asyncio async def test_validat<|fim_suffix|> fake_send(cmd, params, **kwargs): return { "success": True, "data": { "diagnostics": [ {"severity": "war...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>sport, "send_with_unity_instance", fake_send) ctx = DummyContext() resp = await send_mutation(ctx, None, "manage_script", {"action": "create"}) assert resp.get("success") is True assert call_count == 2 @pytest.mark.asyncio async def test_send_mutation_calls_verify_on_connection_lost(mon...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>"""Unit tests for Unity MCP CLI.""" import json import pytest from unittest.mock import patch, MagicMock, AsyncMock from click.testing import CliRunner from cli.main import cli from cli.utils.config import CLIConfig, get_config, set_config from cli.utils.output import format_output, format_as_json, form...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Characterization tests for CLI Commands domain (Server-Side Tools). This test suite captures CURRENT behavior of CLI command modules without refactoring. Tests are designed to identify common patterns and boilerplate across command implementations. Domain: /Server/src/cli/commands/ Modules sampled: ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Characterization tests for Core Infrastructure domain (logging, telemetry, config). These tests capture the CURRENT behavior of the Core Infrastructure without refactoring. They document decorator patterns, logging flows, telemetry collection, and configuration handling as they exist today. Key patt...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ls.resolve_project_id_for_unity_instance", return_value="project-hash"): with patch("services.resources.custom_tools.CustomToolService.get_instance", return_value=service): await get_custom_tools(ctx) service.list_registered_tools.assert_awaited_once_with("project-hash", user_id="...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>mespace(), action="get_history", limit=999)) assert mock_unity["params"]["limit"] == 50 def test_get_history_clamps_negative_limit(mock_unity): asyncio.run(execute_code(SimpleNamespace(), action="get_history", limit=-5)) assert mock_unity["params"]["limit"] == 1 # --- replay action --- de...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ith patch("utils.focus_nudge._is_available", return_value=False): result = await nudge_unity_focus(force=True) assert result is False @pytest.mark.asyncio async def test_skips_when_unity_already_focused(self): from utils.focus_nudge import _FrontmostAppInfo ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ide_expands_user(self): path = resolve_log_dir( platform="linux", env={"UNITY_MCP_LOG_DIR": "~/my-logs"}, ) assert path == os.path.expanduser("~/my-logs") assert "~" not in path def _norm(p: str) -> str: """Normalize for cross-host comparison: ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>"""Tests for manage_animation tool and CLI commands.""" import asyncio import json import pytest from unittest.mock import patch, MagicMock, AsyncMock from click.testing import CliRunner from cli.commands.animation import animation from cli.utils.config import CLIConfig from services.tools.manage_animat...
fim
CoplayDev/unity-mcp
python
"""Tests for manage_build MCP tool.""" import asyncio from types import SimpleNamespace from unittest.mock import AsyncMock import pytest from services.tools.manage_build import ALL_ACTIONS, manage_build @pytest.fixture def mock_unity(monkeypatch): """Patch Unity transport layer and return captured call dict."...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>) ) assert result["success"] is True assert mock_unity["params"]["properties"] == '{"name": "TestCam", "preset": "follow"}' def test_non_dict_response_wrapped(monkeypatch): """When Unity returns a non-dict, it should be wrapped.""" monkeypatch.setattr( "services.tools.manage_...
fim
CoplayDev/unity-mcp
python
"""Tests for manage_editor tool.""" import asyncio import inspect from types import SimpleNamespace from unittest.mock import AsyncMock import pytest from services.tools.manage_editor import manage_editor import services.tools.manage_editor as manage_editor_mod from services.registry import get_registered_tools # ──...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>ty, action_name): """Every valid action should be forwarded to Unity without error.""" result = asyncio.run( manage_graphics(SimpleNamespace(), action=action_name) ) assert result["success"] is True assert mock_unity["tool_name"] == "manage_graphics" assert mock_unity["para...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>"""Tests for manage_packages tool and CLI commands.""" import asyncio import pytest from unittest.mock import patch, MagicMock, AsyncMock from click.testing import CliRunner from cli.commands.packages import packages from cli.utils.config import CLIConfig from services.tools.manage_packages import ALL_A...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import asyncio from types import SimpleNamespace from unittest.mock import AsyncMock import pytest from services.tools.manage_physics import manage_physics, ALL_ACTIONS @pytest.fixture def mock_unity(monkeypatch): captured = {} async def fake_send(send_fn, unity_instance, tool_name, params): ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>s", {}).get("description", "") assert "open_prefab_stage" in desc def test_description_mentions_save_prefab_stage(self): """The tool description should mention save_prefab_stage.""" prefab_tool = next( (t for t in get_registered_tools() if t["name"] == "manage_pref...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>mock_unity): result = asyncio.run( manage_probuilder(SimpleNamespace(), action="ping") ) assert result["success"] is True assert mock_unity["params"]["action"] == "ping" # --------------------------------------------------------------------------- # All actions are lowercase-norm...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>: expected = {"frame_debugger_enable", "frame_debugger_disable", "frame_debugger_get_events"} assert set(FRAME_DEBUGGER_ACTIONS) == expected def test_utility_actions(): assert UTILITY_ACTIONS == ["ping"] def test_all_actions_is_union(): expected = set(UTILITY_ACTIONS + SESSION_ACTIONS ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>e(), action="validate", auto_repair=True, )) assert result["success"] is True assert mock_unity["params"]["autoRepair"] is True # ── None params omitted ───────────────────────────────────────────── def test_none_params_omitted(mock_unity): result = asyncio.run(manage_scene(SimpleNames...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>from __future__ import annotations import asyncio from types import SimpleNamespace from unittest.mock import AsyncMock from services.tools.manage_vfx import manage_vfx def test_manage_vfx_accepts_particle_create(monkeypatch) -> None: captured: dict[str, object] = {} async def fake_send_with_...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>""" Characterization tests for Models & Data Structures domain. Tests capture CURRENT behavior of models in: - Server/src/models/models.py (MCPResponse, UnityInstanceInfo, ToolParameterModel, ToolDefinitionModel) - Server/src/models/unity_response.py (normalize_unity_response function) Domain Overvi...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>", "searchTerm": "camel"}) assert m.search_term == "snake" def test_alias_choices_with_default_value(self): """AliasChoices works with optional parameters that have defaults.""" class TestModel(BaseModel): search_method: Annotated[ str, ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>import pytest from services.registry import get_registered_tools, mcp_for_unity_tool import services.registry.tool_registry as tool_registry_module @pytest.fixture(autouse=True) def restore_tool_registry_state(): original_registry = list(tool_registry_module._tool_registry) try: yield ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>lue=[]): with patch("transport.unity_instance_middleware.PluginHub.get_sessions", new_callable=AsyncMock) as mock_get_sessions: with patch("transport.unity_instance_middleware.PluginHub.get_tools_for_project", new_callable=AsyncMock) as mock_get_tools: ...
fim
CoplayDev/unity-mcp
python
<|fim_suffix|>manual action tests (mock _fetch_url) # --------------------------------------------------------------------------- def test_get_manual_success(): async def mock_fetch(url): return (200, SAMPLE_MANUAL_HTML) with patch("services.tools.unity_docs._fetch_url", side_effect=mock_fetch): ...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>from __future__ import annotations import asyncio from types import SimpleNamespace from unittest.mock import AsyncMock import pytest from services.registry.tool_registry import TOOL_GROUPS, DEFAULT_ENABLED_GROUPS from services.tools.unity_reflect import ( unity_reflect, ALL_ACTIONS, VALID_...
fim
CoplayDev/unity-mcp
python
<|fim_prefix|>using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using System; using System.IO; using System.Reflection; [CustomEditor(typeof(Readme))] [InitializeOnLoad] public class ReadmeEditor : Editor { static string s_ShowedReadmeSessionStateName = "ReadmeEdito...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using UnityEngine; public class Readme : ScriptableObject { public Texture2D icon; public string title; public Section[] sections; public bool loadedLayout; [Serializabl<|fim_suffix|>nkText, url; } } <|fim_middle|>e] public class Section { public st...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>lic abstract Task<AuthenticationResponse> Authenticate(IAssetStoreClient client, CancellationToken cancellationToken = default); } }<|fim_prefix|>using AssetStoreTools.Api.Responses; using AssetStoreTools.Utility; using System; using System.Collections.Generic; using System.Net.Http; using System.Thre...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>sponse> GetPackageUploadedVersions(Package package, CancellationToken cancellationToken = default); Task<PackageUploadResponse> UploadPackage(IPackageUploader uploader, IProgress<float> progress = null, CancellationToken cancellationToken = default); } }<|fim_prefix|>using AssetStoreTools.Api....
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal interface IAssetStoreClient { void SetSessionId(string sessionId); void ClearSessionId(); Task<HttpResponseMessage> Get(Uri uri, Cancellatio...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Responses; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal interface IAuthent<|fim_suffix|>nToken); } }<|fim_middle|>icationType { Task<AuthenticationResponse> Authenticate(IAssetStoreClient client, CancellationT...
fim
CoplayDev/unity-mcp
csharp
using AssetStoreTools.Api.Responses; using System; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal interface IPackageUploader { Task<PackageUploadResponse> Upload(IAssetStoreClient client, IProgress<float> progress, CancellationToken cancellationToken = de...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> { try { response.EnsureSuccessStatusCode(); } catch { throw new Exception(response.Content.ReadAsStringAsync().Result); } } protected void WaitForUploadCompletion(Task<HttpResponseMess...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Models; using AssetStoreTools.Utility; using System; using System.Collections.Generic; using System.Linq; using UnityEditorInternal; namespace AssetStoreTools.Api { internal class ApiUtility { public static Uri CreateUri(string url, bool includeDefaultAssetStoreQ...
fim
CoplayDev/unity-mcp
csharp
using AssetStoreTools.Api.Models; using AssetStoreTools.Api.Responses; using Newtonsoft.Json.Linq; using System; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal class AssetStoreApi : IAssetStoreApi { private IAssetStoreClient _client; ...
fim
CoplayDev/unity-mcp
csharp
using System; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal class AssetStoreClient : IAssetStoreClient { private HttpClient _httpClient; public AssetStoreClient() { ServicePointManager...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Responses; using System.Collections.Generic; using Syst<|fim_suffix|> { var result = await client.Post(LoginUrl, AuthenticationContent, cancellationToken); cancellationToken.ThrowIfCancellationRequested(); return ParseResponse(result); ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Responses; using System.<|fim_suffix|> = GetAuthenticationContent( new KeyValuePair<string, string>("user", email), new KeyValuePair<string, string>("pass", password) ); } public override async Task<AuthenticationRe...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using Newtonsoft.Json.Serialization; using System.Collections.Generic; namespace AssetStoreTools.Api.M<|fim_suffix|>e.ResolvePropertyName(propertyName); } } public class CachedCategoryResolver : DefaultContractResolver { private static CachedCategoryResolv...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> { nameof(Package.IsCompleteProject), "is_complete_project" }, { nameof(Package.RootGuid), "root_guid" }, { nameof(Package.RootPath), "root_path" }, { nameof(Package.IconUrl), "icon_url" } }; } ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> if (_propertyConversions.ContainsKey(propertyName)) return _propertyConversions[propertyName]; return base.ResolvePropertyName(propertyName); } } } }<|fim_prefix|>using Newtonsoft.Json.Serialization; using System.Collections.Gen...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using Newtonsoft.Json.Serialization; using<|fim_suffix|>ivate AssetStoreUserResolver() { _propertyConversions = new Dictionary<string, string>() { { nameof(User.SessionId), "xunitysession" }, { nameof(User.PublisherId), "p...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> var dict = JsonConvert.DeserializeObject<JObject>(json); if (dict == null) throw new Exception("Response is empty"); // Some json responses return an error field on error if (dict.ContainsKey("error")) { // Server side er...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; namespace AssetStoreTools.Api.Responses { internal class AssetStoreToolsVersionResponse : AssetStoreResponse { public string Version { get; set; } public AssetStoreToolsVersionResponse(<|fim_suffix|>reResponse(json)...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Models; using Newtonsoft.Json; using System; using System.Net; using System.Net.Http; namespace AssetStoreTools.Api.Responses { internal class AuthenticationResponse : AssetStoreResponse { public User User { get; set; } public AuthenticationResponse() : ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>ory>(); var serializer = new JsonSerializer() { ContractResolver = new Category.AssetStoreCategoryResolver() }; foreach (var categoryData in categoryArray) { var category = categoryData...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; using UnityEngine; namespace AssetStoreTools.Api.Responses { internal class PackageThumbnailResponse : AssetStoreResponse { <|fim_suffix|>e() : base() { } public PackageThumbnailResponse(Exception e) : base(e) { } public PackageThumbnailResponse(byte[] textureBytes)...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; namespace AssetStoreTools.Api.Responses { internal class PackageUploadedUnityVersionDataResponse <|fim_suffix|> var data = JsonConvert.DeserializeObject<JObject>(json); try { ...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|>elds are based on the latest version in the json var latestVersion = packageData["versions"].ToObject<JArray>().Last; package.VersionId = latestVersion["id"].ToString(); package.Modified = latestVersion["modified"].ToString(); package.Size =...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> { var property = (JProperty)packageToken; var packageData = property.Value.ToObject<Package>(serializer); // Package Id is the key of the package object packageData.PackageId = property.Name; // Package Icon Url is returned...
fim
CoplayDev/unity-mcp
csharp
<|fim_suffix|> public RefreshedPackageDataResponse(Exception e) : base(e) { } } }<|fim_prefix|>using AssetStoreTools.Api.Models; using System; namespace AssetStoreTools.Api.Responses { internal class RefreshedPackageDataResponse : AssetStoreResponse { public Package Package { get; set; } ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System; namespace AssetStoreTools.Api.Responses { internal class PackageUploadResponse : AssetStoreResponse { <|fim_suffix|>reResponse(json); Status = UploadStatus.Success; Success = true; } catch (Exception e) { ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Responses; using Syste<|fim_suffix|>.Api { internal class SessionAuthentication : AuthenticationBase { public SessionAuthentication(string sessionId) { AuthenticationContent = GetAuthenticationContent( new KeyValuePair<string, s...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Api.Responses; using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace AssetStoreTools.Api { internal class UnityPackageUpload<|fim_suffix|> { try { ...
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>namespace Ass<|fim_suffix|>Default = 0, Success = 1, Fail = 2, Cancelled = 3, ResponseTimeout = 4 } }<|fim_middle|>etStoreTools.Api { internal enum UploadStatus { <|endoftext|>
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("AssetStoreTools.Tests")] [assembly: InternalsVisibleTo("DynamicProxy<|fim_suffix|>tor")] <|fim_middle|>GenAssembly2")] [assembly: InternalsVisibleTo("ab-builder")] [assembly: InternalsVisibleTo("Inspector-Edi<|endoftext|>
fim
CoplayDev/unity-mcp
csharp
<|fim_prefix|>using AssetStoreTools.Previews.Data; using AssetStoreTools.Previews.UI; using AssetStoreTools.Uploader; using AssetStoreTools.Utility; using AssetStoreTools.Validator.Data; using AssetStoreTools.Validator.UI; using System; using UnityEditor; using UnityEngine; namespace AssetStoreTools { internal sta...
fim
CoplayDev/unity-mcp
csharp