From fa55e260c2a8be2e84c564cad2c180672c43113a Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 14:41:23 +0200 Subject: refactor: extract shared error hierarchy + Session into idatui/errors.py The IDAError/IDAConnectionError/IDAToolError/... exceptions and the Session dataclass were defined in client.py (the ida-pro-mcp HTTP client), but the idalib worker path (worker_client/domain/app) needs them without the HTTP transport. Move them to a transport-agnostic errors.py; client.py re-exports them so the deprecated mcp tooling and stress tests are unchanged (verified: errors.IDAToolError IS client.IDAToolError, so cross-module `except` still works). worker_client, domain (TYPE_CHECKING-guarded IDAClient hint), app, and __init__ now import the shared types from errors.py. This decouples the worker path from client.py at runtime -- the prerequisite for deleting the mcp transport. --- idatui/domain.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'idatui/domain.py') diff --git a/idatui/domain.py b/idatui/domain.py index 2a3fc2b..4f72f5b 100644 --- a/idatui/domain.py +++ b/idatui/domain.py @@ -28,9 +28,12 @@ import threading import urllib.request from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass, field, replace -from typing import Callable +from typing import Callable, TYPE_CHECKING -from .client import IDAClient, IDAToolError +from .errors import IDAToolError + +if TYPE_CHECKING: # type hint only; the runtime client is mcp IDAClient or worker + from .client import IDAClient # noqa: F401 # Clamps derived from measured caps (list ~700, disasm ~500). Margin included. LIST_PAGE = 500 -- cgit v1.3.1-sl0p