MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / CommandMessage

Class CommandMessage

relay/protocol.py:173–189  ·  view source on GitHub ↗

Command to Unity

Source from the content-addressed store, hash-verified

171
172
173class CommandMessage(Message):
174 """Command to Unity"""
175
176 model_config = ConfigDict(frozen=True)
177
178 type: Literal["COMMAND"] = "COMMAND"
179 id: str = ""
180 command: str = ""
181 params: dict[str, Any] = Field(default_factory=dict)
182 timeout_ms: int = Field(default=30000, gt=0)
183
184 @field_validator("command")
185 @classmethod
186 def validate_command(cls, v: str) -> str:
187 if not v:
188 raise ValueError("command must not be empty")
189 return v
190
191
192# CLI -> Relay Messages

Callers 2

test_to_dictMethod · 0.90
_execute_commandMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_to_dictMethod · 0.72