Support bounded machine instruction step counts in MCP

This commit is contained in:
Александр Петров
2026-09-17 23:22:37 +03:00
parent e8189b137a
commit 259c782190
13 changed files with 62 additions and 10 deletions
+4 -2
View File
@@ -201,8 +201,10 @@ class McpSession:
def pause_execution(self):
return self.call('pause', {'owner': self.owner})
def step_instruction(self):
return self.call('step', {'owner': self.owner})
def step_instruction(self, count: int = 1):
if not isinstance(count, int) or isinstance(count, bool) or count < 1 or count > 64:
raise SessionError('Число машинных шагов должно быть 1..64')
return self.call('step', {'count': count, 'owner': self.owner})
def step_source(self, kind: str = 'into'):
if kind not in ('into', 'over', 'out'):