intellicrack.ui

User interface components for Intellicrack.

This package provides PyQt6-based UI components including the main application window, chat panel, tool output display, and configuration dialogs.

class AssemblySyntaxHighlighter[source]

Bases: _ThemedSyntaxHighlighter

Syntax highlighter for x86/x64 assembly.

Highlights instructions, registers, addresses, and comments in disassembly output.

Variables:
  • INSTRUCTIONS (ClassVar[tuple[str, ...]]) – Recognized x86/x64 instruction mnemonics.

  • REGISTERS (ClassVar[tuple[str, ...]]) – Recognized CPU register names.

  • MEMORY_KEYWORDS (ClassVar[tuple[str, ...]]) – Recognized memory operand keywords.

INSTRUCTIONS: ClassVar[tuple[str, ...]] = ('mov', 'movsx', 'movzx', 'movsxd', 'lea', 'push', 'pop', 'pushf', 'popf', 'call', 'ret', 'retn', 'jmp', 'je', 'jne', 'jz', 'jnz', 'ja', 'jae', 'jb', 'jbe', 'jg', 'jge', 'jl', 'jle', 'jo', 'jno', 'js', 'jns', 'cmp', 'test', 'add', 'sub', 'mul', 'imul', 'div', 'idiv', 'inc', 'dec', 'and', 'or', 'xor', 'not', 'neg', 'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'nop', 'int', 'syscall', 'sysenter', 'leave', 'enter', 'hlt', 'wait', 'cdq', 'cwd', 'cbw', 'cwde', 'cdqe', 'cqo', 'cmove', 'cmovne', 'cmova', 'cmovae', 'cmovb', 'cmovbe', 'cmovg', 'cmovge', 'cmovl', 'cmovle', 'sete', 'setne', 'seta', 'setae', 'setb', 'setbe', 'setg', 'setge', 'setl', 'setle', 'rep', 'repe', 'repne', 'repz', 'repnz', 'movsb', 'movsw', 'movsd', 'movsq', 'stosb', 'stosw', 'stosd', 'stosq', 'lodsb', 'lodsw', 'lodsd', 'lodsq', 'scasb', 'scasw', 'scasd', 'scasq', 'xchg', 'bswap', 'xadd', 'cmpxchg', 'lock', 'movaps', 'movups', 'movapd', 'movupd', 'movdqa', 'movdqu', 'movss', 'movsd', 'addps', 'addpd', 'addss', 'addsd', 'subps', 'subpd', 'subss', 'subsd', 'mulps', 'mulpd', 'mulss', 'mulsd', 'divps', 'divpd', 'divss', 'divsd', 'sqrtps', 'sqrtss', 'pand', 'por', 'pxor', 'pshufb', 'pshufd', 'punpcklbw', 'punpckhbw', 'vmovaps', 'vmovups', 'vaddps', 'vsubps', 'vmulps', 'vdivps', 'vpand', 'vpor', 'vpxor', 'vzeroupper', 'vzeroall', 'vbroadcastss', 'vbroadcastsd', 'vextractf128', 'vinsertf128', 'vperm2f128', 'vpermilps', 'kandw', 'korw', 'kxorw', 'kmovw', 'kunpckbw', 'fld', 'fst', 'fstp', 'fadd', 'fsub', 'fmul', 'fdiv', 'fxch', 'fcom', 'fcomp', 'fcompp', 'fucom', 'fucomi', 'fldcw', 'fnstcw', 'finit', 'fninit', 'fwait', 'fnclex')
REGISTERS: ClassVar[tuple[str, ...]] = ('rax', 'rbx', 'rcx', 'rdx', 'rsi', 'rdi', 'rbp', 'rsp', 'rip', 'r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15', 'eax', 'ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp', 'esp', 'eip', 'ax', 'bx', 'cx', 'dx', 'si', 'di', 'bp', 'sp', 'al', 'bl', 'cl', 'dl', 'ah', 'bh', 'ch', 'dh', 'sil', 'dil', 'bpl', 'spl', 'r8d', 'r9d', 'r10d', 'r11d', 'r12d', 'r13d', 'r14d', 'r15d', 'r8w', 'r9w', 'r10w', 'r11w', 'r12w', 'r13w', 'r14w', 'r15w', 'r8b', 'r9b', 'r10b', 'r11b', 'r12b', 'r13b', 'r14b', 'r15b', 'cs', 'ds', 'es', 'fs', 'gs', 'ss', 'xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5', 'xmm6', 'xmm7', 'xmm8', 'xmm9', 'xmm10', 'xmm11', 'xmm12', 'xmm13', 'xmm14', 'xmm15', 'ymm0', 'ymm1', 'ymm2', 'ymm3', 'ymm4', 'ymm5', 'ymm6', 'ymm7', 'ymm8', 'ymm9', 'ymm10', 'ymm11', 'ymm12', 'ymm13', 'ymm14', 'ymm15', 'zmm0', 'zmm1', 'zmm2', 'zmm3', 'zmm4', 'zmm5', 'zmm6', 'zmm7', 'zmm8', 'zmm9', 'zmm10', 'zmm11', 'zmm12', 'zmm13', 'zmm14', 'zmm15', 'zmm16', 'zmm17', 'zmm18', 'zmm19', 'zmm20', 'zmm21', 'zmm22', 'zmm23', 'zmm24', 'zmm25', 'zmm26', 'zmm27', 'zmm28', 'zmm29', 'zmm30', 'zmm31', 'k0', 'k1', 'k2', 'k3', 'k4', 'k5', 'k6', 'k7', 'st', 'st0', 'st1', 'st2', 'st3', 'st4', 'st5', 'st6', 'st7')
MEMORY_KEYWORDS: ClassVar[tuple[str, ...]] = ('byte', 'word', 'dword', 'qword', 'ptr', 'offset')
__init__(parent=None)[source]

Initialize the AssemblySyntaxHighlighter with assembly highlighting rules.

Parameters:

parent (QTextDocument | None) – Parent QTextDocument to highlight.

Return type:

None

highlightBlock(text)[source]

Apply highlighting to a block of text.

Parameters:

text (str | None) – The text block to highlight.

Return type:

None

class CSyntaxHighlighter[source]

Bases: _ThemedSyntaxHighlighter

Syntax highlighter for C/C++ code.

Highlights keywords, types, strings, numbers, comments, and function calls in decompiled C code.

Variables:
  • KEYWORDS (ClassVar[tuple[str, ...]]) – C/C++ reserved keyword strings for syntax highlighting.

  • TYPES (ClassVar[tuple[str, ...]]) – C/C++ type names including Windows SDK types for highlighting.

KEYWORDS: ClassVar[tuple[str, ...]] = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', 'if', 'int', 'long', 'register', 'return', 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while', 'bool', 'true', 'false', 'nullptr', 'class', 'public', 'private', 'protected', 'virtual', 'inline', 'template', 'typename', 'namespace', 'using', 'try', 'catch', 'throw', 'new', 'delete', 'this', 'operator')
TYPES: ClassVar[tuple[str, ...]] = ('int8_t', 'int16_t', 'int32_t', 'int64_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'size_t', 'ssize_t', 'ptrdiff_t', 'intptr_t', 'uintptr_t', 'BYTE', 'WORD', 'DWORD', 'QWORD', 'BOOL', 'HANDLE', 'LPVOID', 'LPCSTR', 'LPWSTR', 'HMODULE', 'FARPROC', 'HRESULT', 'undefined', 'undefined1', 'undefined2', 'undefined4', 'undefined8')
__init__(parent=None)[source]

Initialize the CSyntaxHighlighter with C/C++ highlighting rules.

Parameters:

parent (QTextDocument | None) – Parent QTextDocument to highlight.

Return type:

None

highlightBlock(text)[source]

Apply highlighting to a block of text.

Parameters:

text (str | None) – The text block to highlight.

Return type:

None

class ChatInput[source]

Bases: QFrame

Chat input widget with send button.

Provides a text input area and send button for composing messages to send to the AI.

Variables:

message_submitted – Qt signal for message submitted.

__init__(parent=None)[source]

Initialize the ChatInput widget.

Parameters:

parent (QWidget | None) – Parent widget.

Return type:

None

set_enabled(*, enabled)[source]

Enable or disable the input.

Parameters:

enabled (bool) – Whether input should be enabled.

Return type:

None

clear()[source]

Clear the input text.

Return type:

None

set_focus()[source]

Set focus to the text input.

Return type:

None

set_text(text)[source]

Set the input text content.

Parameters:

text (str) – Text to set in the input field.

Return type:

None

class ChatPanel[source]

Bases: QFrame

Main chat panel widget.

Contains the message history scroll area and input widget. Manages displaying conversation messages and collecting user input.

Variables:
  • message_submitted – Qt signal for message submitted.

  • context_requested – Qt signal asking to browse the MCP servers’ resources and prompts.

  • tool_activity (ToolActivityPanel) – The tool calls running now, with their progress and a way to cancel each one.

tool_activity: ToolActivityPanel
__init__(parent=None)[source]

Initialize the ChatPanel widget.

Parameters:

parent (QWidget | None) – Parent widget.

Return type:

None

add_message(message)[source]

Add a message to the chat.

Parameters:

message (Message) – Message to add.

Return type:

None

restore_messages(messages)[source]

Replace the visible conversation with a previously saved history.

Renders through the same bubble construction live turns use, so a restored session is indistinguishable from one built up interactively, and scrolls once at the end rather than once per message.

Parameters:

messages (Sequence[Message]) – Ordered conversation history to display.

Return type:

None

add_streaming_message()[source]

Create a streaming message and return the append function.

The created Message is tracked as the panel’s active streaming message until finalize_streaming_message() folds the orchestrator’s completed response into it, so a turn that streams its text never gets a second, duplicate bubble for the same content (S16 duplicate-assistant-bubble fix).

Returns:

Function to call with each text chunk.

Return type:

Callable[[str], None]

finalize_streaming_message(message)[source]

Fold a completed assistant message into the active streaming bubble.

A turn’s streamed text already reached the panel chunk-by-chunk via the append function add_streaming_message() returned, so message.content is not applied here – the tracked message’s content, built incrementally, is already authoritative. This only merges the metadata the streaming path could not carry: tool calls, tool results, and any thinking content the provider reported.

Calling this with no active streaming message (add_streaming_message was never invoked for the current turn) falls back to add_message() so the completed message is still rendered.

Parameters:

message (Message) – The orchestrator’s completed message for this turn.

Return type:

None

clear_messages()[source]

Clear all messages from the chat.

Return type:

None

show_notice(text)[source]

Add a short notice above the message input, such as a server’s resource changing.

The most recent few are shown, newest last, so one notice is not hidden by others that arrive with it.

Parameters:

text (str) – The notice, already cleaned.

Return type:

None

property notice: str

The notices shown now.

Returns:

The notices, one per line, or an empty string.

Return type:

str

set_input_enabled(*, enabled)[source]

Enable or disable the input widget.

Parameters:

enabled (bool) – Whether input should be enabled.

Return type:

None

get_messages()[source]

Get all messages in the chat.

Returns:

List of messages.

Return type:

list[Message]

set_focus_input()[source]

Set focus to the input widget.

Return type:

None

insert_context_text(text)[source]

Insert context text into the chat input field.

Replaces the current input content with the provided text and sets focus to the input widget for immediate editing or submission.

Parameters:

text (str) – Context text to insert.

Return type:

None

class CodeDisplay[source]

Bases: QPlainTextEdit

Code display widget with syntax highlighting.

Provides a read-only text area for displaying code with appropriate syntax highlighting based on language.

__init__(language='c', parent=None)[source]

Initialize the CodeDisplay with syntax highlighting for the given language.

Parameters:
  • language (str) – Programming language for syntax highlighting.

  • parent (QWidget | None) – Parent widget.

Return type:

None

set_language(language)[source]

Set the syntax highlighting language.

Parameters:

language (str) – Programming language.

Return type:

None

get_highlighter()[source]

Get the current syntax highlighter.

Returns:

The syntax highlighter or None.

Return type:

QSyntaxHighlighter | None

set_content(content)[source]

Set the displayed content.

Parameters:

content (str) – Text content to display.

Return type:

None

append_content(content)[source]

Append content to the display.

Parameters:

content (str) – Text content to append.

Return type:

None

goto_line(line_number)[source]

Scroll to a specific line.

Parameters:

line_number (int) – 1-based line number.

Return type:

None

class FontManager[source]

Bases: object

Singleton font manager for custom font loading and management.

Handles loading custom fonts from the assets directory and provides font instances for code and UI elements.

__init__()[source]

Initialize the FontManager instance.

Return type:

None

classmethod get_instance()[source]

Get the singleton instance of FontManager.

Returns:

The FontManager singleton instance.

Return type:

FontManager

classmethod reset_instance()[source]

Reset the singleton instance (primarily for testing).

Return type:

None

load_fonts()[source]

Load all custom fonts from the fonts directory.

Returns:

True if at least one font was loaded successfully.

Return type:

bool

get_code_font(size=None)[source]

Get a font suitable for code display.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.code_default value from font_config.json (falling back to 10 if unconfigured).

Returns:

QFont configured for code display.

Return type:

QFont

get_code_font_bold(size=None)[source]

Get a bold font suitable for code display.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.code_default value from font_config.json (falling back to 10 if unconfigured).

Returns:

QFont configured for bold code display.

Return type:

QFont

get_ui_font(size=None)[source]

Get a font suitable for UI elements.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_default value from font_config.json (falling back to 9 if unconfigured).

Returns:

QFont configured for UI display.

Return type:

QFont

get_ui_font_bold(size=None)[source]

Get a bold font suitable for UI elements.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_default value from font_config.json (falling back to 9 if unconfigured).

Returns:

QFont configured for bold UI display.

Return type:

QFont

get_heading_font(size=None)[source]

Get a font suitable for headings.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_large value from font_config.json (falling back to 12 if unconfigured).

Returns:

QFont configured for heading display.

Return type:

QFont

property code_font_family: str

The current code font family name.

Returns:

Code font family name.

Return type:

str

property ui_font_family: str

The current UI font family name.

Returns:

UI font family name.

Return type:

str

property loaded_families: list[str]

List of all loaded font families.

Returns:

List of loaded font family names.

Return type:

list[str]

is_custom_font_loaded()[source]

Check if any custom fonts were loaded.

Returns:

True if custom fonts were loaded successfully.

Return type:

bool

get_font_info()[source]

Get information about loaded fonts.

Returns:

Dictionary with font loading status and details.

Return type:

dict[str, object]

class FunctionListPanel[source]

Bases: QFrame

Panel showing list of functions in the binary.

Allows navigation to specific functions by clicking.

Variables:

function_selected – Qt signal for function selected. The address argument is declared qint64 so 64-bit virtual addresses are not truncated to 32 bits by Qt’s default int marshalling.

__init__(parent=None)[source]

Initialize the FunctionListPanel.

Parameters:

parent (QWidget | None) – Parent widget.

Return type:

None

set_functions(functions)[source]

Set the function list.

Parameters:

functions (list[tuple[str, int]]) – List of (name, address) tuples.

Return type:

None

get_functions()[source]

Get the current list of functions.

Returns:

List of (name, address) tuples.

Return type:

list[tuple[str, int]]

class HighlightRule[source]

Bases: object

A syntax highlighting rule.

__init__(pattern, text_format, group=0)[source]

Initialize the HighlightRule with a pattern, format, and capture group.

Parameters:
  • pattern (str) – Regular expression pattern to match.

  • text_format (QTextCharFormat) – Text character format to apply to matches.

  • group (int) – Index of the regex capture group whose span receives the format. 0 (the default) formats the whole match; a positive index formats only that captured subgroup, which keyword rules such as def\s+(name) use so the format lands on the captured name rather than the keyword itself.

Return type:

None

pattern
format
group
class IconManager[source]

Bases: object

Singleton icon manager with caching and fallback support.

Provides centralized icon loading for the Intellicrack UI with performance optimization through caching and graceful degradation when icon files are not available.

__init__()[source]

Initialize the IconManager instance.

Return type:

None

classmethod get_instance()[source]

Get the singleton instance of IconManager.

Returns:

The IconManager singleton instance.

Return type:

IconManager

classmethod reset_instance()[source]

Reset the singleton instance (primarily for testing).

Return type:

None

get_icon(name, size=24)[source]

Get an icon by name with caching.

Parameters:
  • name (str) – Icon name (key in ICON_MAP or filename without extension).

  • size (int) – Preferred icon size in pixels.

Returns:

QIcon instance (may be empty if icon not found and no fallback).

Return type:

QIcon

get_pixmap(name, size=24)[source]

Get a pixmap by icon name.

Parameters:
  • name (str) – Icon name.

  • size (int) – Desired pixmap size.

Returns:

QPixmap of the requested size.

Return type:

QPixmap

get_app_icon()[source]

Get the main application icon.

Returns:

QIcon for the application window and taskbar.

Return type:

QIcon

get_status_icon(*, success)[source]

Get a status icon indicating success or failure.

Parameters:

success (bool) – True for success icon, False for error icon.

Returns:

Appropriate status icon.

Return type:

QIcon

get_status_pixmap(*, success, size=16)[source]

Get a status pixmap indicating success or failure.

Parameters:
  • success (bool) – True for success, False for error.

  • size (int) – Pixmap size in pixels.

Returns:

Appropriate status pixmap.

Return type:

QPixmap

clear_cache()[source]

Clear all cached icons and pixmaps.

Return type:

None

preload_icons(names=None)[source]

Preload icons into cache for faster access.

Parameters:

names (list[str] | None) – List of icon names to preload. If None, preloads common icons.

Return type:

None

static list_available_icons()[source]

List all available icon names.

Returns:

List of icon names from ICON_MAP.

Return type:

list[str]

icon_exists(name)[source]

Check if an icon file exists.

Parameters:

name (str) – Icon name to check.

Returns:

True if the icon file exists.

Return type:

bool

class JavaScriptSyntaxHighlighter[source]

Bases: _ThemedSyntaxHighlighter

Syntax highlighter for JavaScript code.

Highlights JavaScript/Frida script keywords, functions, strings, numbers, and comments.

Variables:
  • KEYWORDS (ClassVar[tuple[str, ...]]) – JavaScript reserved keywords.

  • FRIDA_GLOBALS (ClassVar[tuple[str, ...]]) – Frida API global object names.

KEYWORDS: ClassVar[tuple[str, ...]] = ('async', 'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'of', 'return', 'static', 'super', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield', 'true', 'false', 'null', 'undefined')
FRIDA_GLOBALS: ClassVar[tuple[str, ...]] = ('Process', 'Module', 'Memory', 'Interceptor', 'NativeFunction', 'NativeCallback', 'NativePointer', 'ptr', 'NULL', 'Thread', 'Stalker', 'DebugSymbol', 'Instruction', 'ObjC', 'Java', 'send', 'recv', 'console', 'rpc', 'Script', 'Kernel', 'Socket')
__init__(parent=None)[source]

Initialize the JavaScriptSyntaxHighlighter with JavaScript highlighting rules.

Parameters:

parent (QTextDocument | None) – Parent QTextDocument to highlight.

Return type:

None

highlightBlock(text)[source]

Apply highlighting to a block of text.

Parameters:

text (str | None) – The text block to highlight.

Return type:

None

class MainWindow[source]

Bases: QMainWindow

Main application window for Intellicrack.

Combines chat panel, tool output panel, menus, and toolbar into the main application interface.

Variables:
  • message_received – Qt signal for message received.

  • tool_call_received – Qt signal for tool call received.

  • tool_result_received – Qt signal for tool result received.

  • tool_progress_received – Qt signal carrying a running tool call’s ToolProgress.

  • stream_chunk_received – Qt signal for stream chunk received.

  • status_update – Qt signal for status update.

  • bridge_analysis_received – Qt signal for bridge analysis received.

  • confirmation_requested – Qt signal for tool-confirmation dialog request.

__init__(config, orchestrator, parent=None)[source]

Initialize the MainWindow with the given configuration and orchestrator.

Parameters:
  • config (Config) – Application configuration.

  • orchestrator (Orchestrator) – AI agent orchestrator.

  • parent (QWidget | None) – Parent widget.

Return type:

None

showEvent(a0)[source]

Wire up the per-monitor screen-change watcher on first show.

The window has no native QWindow handle until it is shown for the first time, so the screenChanged connection (D28) is deferred to here and made exactly once, guarded by _screen_watcher_connected.

Parameters:

a0 (QShowEvent | None) – The show event.

Return type:

None

wire_script_manager(manager, validator=None)[source]

Wire a script manager and validator into the UI and the orchestrator.

The orchestrator is re-pointed at this manager, replacing the fallback _configure_orchestrator() built during construction. Without that, the two halves of the scripting surface own separate managers over separate directories: the Scripts panel reads and writes the one wired here, while the orchestrator records every tool execution into its own. A script the user authored is then absent from the orchestrator’s registry, so record_execution finds nothing to record against and the run is dropped.

Parameters:
  • manager (object) – ScriptManager instance.

  • validator (object | None) – Optional ScriptValidator instance.

Return type:

None

wire_sandbox_backend(sandbox, manager=None)[source]

Inject an externally constructed sandbox backend into the UI.

Public entry point used by plugins, CLI bootstraps, and the application startup path to register a pre-existing SandboxBase (and optional SandboxManager) so the sandbox tab, chat workflow, and AI bridges can drive it. When manager is supplied it replaces the lazy manager on the resulting SandboxBridge; otherwise the bridge constructs its own. The supplied manager (or the bridge’s lazily created one) is also installed on the window as sandbox_manager so the sandbox configuration dialog and teardown paths see the same instance the panel sees.

Parameters:
  • sandbox (SandboxBase) – Pre-constructed SandboxBase implementation.

  • manager (SandboxManager | None) – Optional pre-constructed SandboxManager to install on the resulting bridge. When None the bridge’s lazy manager is used.

Return type:

None

set_script_generator(generator)[source]

Persist the application-scoped ScriptGenerator instance.

ScriptGenerator is the API surface used by AI/tool bridges to prepare prompts for script generation. Holding the instance on the main window keeps it alive for the lifetime of the application and gives downstream panels a stable handle to reach it.

Parameters:

generator (ScriptGenerator) – ScriptGenerator instance constructed during startup.

Return type:

None

set_template_manager(manager)[source]

Persist the application-scoped TemplateManager instance.

TemplateManager owns the on-disk built-in and user template directories under config_dir/templates/ and surfaces them to the hex editor pattern UI.

Parameters:

manager (TemplateManager) – TemplateManager instance bootstrapped during startup.

Return type:

None

set_model_discovery(discovery)[source]

Set the model discovery instance.

Parameters:

discovery (ModelDiscovery) – ModelDiscovery for provider model enumeration.

Return type:

None

property log_viewer_window: LogViewerWindow | None

The live Log Viewer instance, if one has been opened.

Returns:

The cached viewer instance, or

None when it has not been constructed yet (or was disposed after the main window closed).

Return type:

LogViewerWindow | None

open_log_viewer()[source]

Open (or raise) the modeless Log Viewer window.

The viewer is constructed lazily on first call and reused on subsequent calls so window state, filters, and history are preserved across re-opens.

Returns:

The active viewer instance.

Return type:

LogViewerWindow

on_open_x64dbg()[source]

Open x64dbg debugger panel.

Return type:

None

on_open_cutter()[source]

Open Cutter reverse engineering panel.

Return type:

None

closeEvent(a0)[source]

Handle window close event.

Checks for unsaved hex editor changes, persists window state, then shuts down bridges, sandbox, and background workers.

Parameters:

a0 (QCloseEvent | None) – Close event.

Return type:

None

class McpServerConsentDialog[source]

Bases: QDialog

Asks the operator to approve launching one local MCP server.

Emits decision_made(approved: bool, trusted: bool, blocked: bool) when answered. trusted reports the “trust this server” checkbox, which is a separate and stronger grant than approving the launch: it decides whether the server’s own claims about its tools are believed during classification, so it is off by default and stays off unless the operator ticks it. blocked reports the “never start this server” button: Cancel refuses this launch only, so the next start asks again, while blocking refuses until the operator resets it in MCP Settings.

__init__(config, description, findings, parent=None)[source]

Initialize the consent dialog.

Parameters:
  • config (McpServerConfig) – The server about to be launched.

  • description (str) – The rendered launch description, from describe_launch().

  • findings (Sequence[DangerousPattern]) – Patterns the consent scan flagged.

  • parent (QWidget | None) – Parent widget.

Return type:

None

classmethod for_config(config, env, parent=None)[source]

Build a dialog by rendering the launch description itself.

Parameters:
  • config (McpServerConfig) – The server about to be launched.

  • env (dict[str, str]) – The fully resolved environment the child would receive.

  • parent (QWidget | None) – Parent widget.

Returns:

The dialog, ready to execute.

Return type:

McpServerConsentDialog

Raises:

ValueError – If the server has no launch description, which means it is not a local server and needs no launch consent.

property approved: bool

Whether the operator approved the launch.

Returns:

True when approved.

Return type:

bool

property trusted: bool

Whether the operator also marked the server trusted.

Returns:

True when the trust checkbox was ticked.

Return type:

bool

property blocked: bool

Whether the operator asked never to start this server.

Returns:

True when the never-start button was pressed.

Return type:

bool

make_decision(*, approved, blocked=False)[source]

Apply an answer and finalise the dialog.

Parameters:
  • approved (bool) – True when the operator approved the launch.

  • blocked (bool) – True when the operator refused this server for good. Ignored alongside an approval.

Return type:

None

class MessageBubble[source]

Bases: QFrame

A single message bubble in the chat.

Displays a message from the user, assistant, or tool with appropriate styling and formatting.

Variables:

content_label (intellicrack.ui.chat._MarkdownView) – Markdown-rendering view displaying the message content; updated directly by streaming consumers to append incremental chunks.

__init__(message, parent=None)[source]

Initialize the MessageBubble with the given message.

Parameters:
  • message (Message) – The message to display.

  • parent (QWidget | None) – Parent widget.

Return type:

None

content_label: _MarkdownView
class ModelSelectionDialog[source]

Bases: QDialog

Dialog for selecting a specific model from a provider.

Displays available models with their capabilities and allows the user to select one.

Variables:

model_selected (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when a model is selected.

__init__(models, current_model=None, provider_name=None, discovery=None, parent=None)[source]

Initialize the ModelSelectionDialog with available models.

Parameters:
  • models (list[ModelInfo]) – List of available models to display.

  • current_model (str | None) – Currently selected model identifier.

  • provider_name (str | None) – Name of the provider these models belong to.

  • discovery (ModelDiscovery | None) – Optional model discovery service for filtering and recommendations.

  • parent (QWidget | None) – Parent widget.

Return type:

None

get_selected_model()[source]

Get the selected model ID.

Returns:

Selected model ID or None if nothing selected.

Return type:

str | None

class NewSessionDialog[source]

Bases: QDialog

Dialog for creating a new session.

Allows users to specify session name and initial settings.

__init__(parent=None)[source]

Initialize the NewSessionDialog.

Parameters:

parent (QWidget | None) – Parent widget.

Return type:

None

get_session_name()[source]

Get the entered session name.

Returns:

Session name.

Return type:

str

get_description()[source]

Get the entered description.

Returns:

Session description.

Return type:

str

class PreferencesDialog[source]

Bases: QDialog

Preferences dialog with categorized settings.

Provides a unified interface for configuring all application settings organized into logical categories.

Variables:
  • settings_changed – Qt signal for settings changed.

  • mcp_settings_requested – Qt signal asking the main window to open the MCP server settings. Preferences does not own the MCP client – connections are application-lifetime and live on the background loop – so it forwards the request rather than building a second dialog against state it cannot reach.

__init__(config, parent=None)[source]

Initialize the PreferencesDialog with application configuration.

Parameters:
  • config (Config) – Application configuration instance.

  • parent (QWidget | None) – Parent widget.

Return type:

None

set_config_path(path)[source]

Set the configuration file path for saving.

Parameters:

path (Path) – Path to the configuration file.

Return type:

None

get_config()[source]

Get the current configuration.

Returns:

The current configuration object.

Return type:

Config

class ProviderConfigDialog[source]

Bases: QDialog

Dialog for configuring LLM providers.

Allows users to: - Enter API keys for each provider - Select default models - Configure timeout and retry settings - Test provider connections - Set active provider for analysis - View connection status and model counts

Variables:
  • provider_updated (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when a provider config changes.

  • active_provider_changed (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when active provider changes.

  • instances_changed (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when a provider instance is added, duplicated, imported or deleted, so every provider selector can be rebuilt.

__init__(provider_registry=None, model_discovery=None, parent=None)[source]

Initialize the ProviderConfigDialog.

Parameters:
  • provider_registry (ProviderRegistry | None) – Optional registry of available LLM providers.

  • model_discovery (ModelDiscovery | None) – Optional model discovery service for fetching available models.

  • parent (QWidget | None) – Parent widget.

Return type:

None

get_settings()[source]

Get all provider settings.

Returns:

Dictionary mapping provider IDs to their settings.

Return type:

dict[str, dict[str, Any]]

refresh_credentials()[source]

Reload credentials from env files and credential store.

Return type:

None

create_env_template()[source]

Write or merge a .env credential template, then report the outcome.

Never truncates an existing .env: pre-existing content is backed up to a timestamped .env.<timestamp>.bak file and only template variables missing from the file are appended, so any real credential already saved there is preserved.

Return type:

None

migrate_credentials()[source]

Migrate credentials from env files to credential store.

The store write runs on the persistent bridge event loop via run_bridge_coroutine_async so the keyring/file I/O performed for every provider found in the environment cannot freeze the GUI thread; the credential overview is reloaded once migration completes, whether it succeeded or failed.

Return type:

None

discover_single_provider(provider_name)[source]

Discover models for a specific provider.

The network round-trip to the provider’s model-listing API runs on the persistent bridge event loop via run_bridge_coroutine_async so it cannot freeze the GUI thread; provider status is refreshed once discovery completes.

Parameters:

provider_name (str) – Name of the provider to discover models for.

Return type:

None

start_oauth_flow(provider_id)[source]

Start an OAuth authorization flow for a provider.

Parameters:

provider_id (str) – The provider to authorize.

Return type:

None

revoke_oauth_token(provider_id)[source]

Revoke the OAuth token or delete the stored API key for a provider.

Parameters:

provider_id (str) – The provider whose credential should be revoked.

Return type:

None

class ProviderSettingsWidget[source]

Bases: QFrame

Widget for configuring a single provider.

Displays API key input, model selection, connection settings, and credential source information for a specific LLM provider.

Variables:
  • connection_tested (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted after connection test.

  • ollama_pull_progress (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted per pull_model status chunk with (model_name, status).

  • ollama_pull_finished (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted on pull_model completion with (success, model_name, message).

  • generation_lookup_finished (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted on OpenRouter generation cost lookup completion with (success, generation_id, message).

__init__(provider_id, registry=None, config_path=None, credential_detector=None, model_discovery=None, parent=None, *, credential_loader=None)[source]

Initialize the ProviderSettingsWidget for a single provider.

Parameters:
  • provider_id (str) – Identifier of the provider to configure.

  • registry (ProviderRegistry | None) – Optional provider registry for connection management.

  • config_path (Path | None) – Optional path to the provider configuration file.

  • credential_detector (CredentialSourceDetector | None) – Optional detector for identifying credential sources.

  • model_discovery (ModelDiscovery | None) – Optional model discovery service.

  • parent (QWidget | None) – Parent widget.

  • credential_loader (CredentialLoader | None) – Loader bound to the .env file that API keys and endpoint settings are read from and saved to. Defaults to the global loader for the application’s .env file.

Return type:

None

property is_custom_instance: bool

Whether this widget configures a user-defined instance.

Returns:

True for any provider id that is not one of the eight built-ins, which is exactly the set stored as instance records.

Return type:

bool

set_api_key(api_key)[source]

Set the API key input text.

Parameters:

api_key (str) – The API key value to set.

Return type:

None

get_settings()[source]

Get current settings as a dictionary.

Returns:

Dictionary of current settings.

Return type:

dict[str, Any]

save_settings()[source]

Save current settings: preferences to providers.json, credentials and endpoints to .env.

Every provider keeps its providers.json section whether or not it has an API key, so its enabled flag, timeout, model and device options survive. The API key, base URL and organization are persisted only in .env, which startup reads.

Return type:

None

get_provider_device_info()[source]

Get device info for local transformer providers.

Attempts to use the registered provider instance from the registry before falling back to creating a new provider.

Returns:

Device information dict or None if not applicable.

Return type:

dict[str, Any] | None

pull_ollama_model(model_name)[source]

Pull an Ollama model, streaming progress to the status label.

Executes OllamaProvider.pull_model — an async generator yielding server-sent status lines — on the persistent bridge event loop via run_bridge_coroutine_async. Each status chunk is forwarded to the Qt main thread through the ollama_pull_progress signal, and the terminal outcome via ollama_pull_finished.

Parameters:

model_name (str) – Name of the model to pull.

Return type:

None

get_openrouter_generation(generation_id)[source]

Look up OpenRouter generation cost info for cost tracking.

The network round-trip is dispatched on the persistent bridge event loop via run_bridge_coroutine_async so it cannot freeze the GUI thread; the outcome is delivered through the generation_lookup_finished signal.

Parameters:

generation_id (str) – The generation ID to look up.

Return type:

None

get_xpu_optimal_dtype()[source]

Get optimal dtype for XPU inference.

Returns:

Optimal dtype string or None.

Return type:

str | None

class PythonSyntaxHighlighter[source]

Bases: _ThemedSyntaxHighlighter

Syntax highlighter for Python code.

Highlights Python keywords, built-ins, strings, numbers, and comments in Python scripts.

Variables:
  • KEYWORDS (ClassVar[tuple[str, ...]]) – Python reserved keywords.

  • BUILTINS (ClassVar[tuple[str, ...]]) – Python built-in function and type names.

KEYWORDS: ClassVar[tuple[str, ...]] = ('False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield')
BUILTINS: ClassVar[tuple[str, ...]] = ('abs', 'all', 'any', 'bin', 'bool', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip')
__init__(parent=None)[source]

Initialize the PythonSyntaxHighlighter with Python highlighting rules.

Parameters:

parent (QTextDocument | None) – Parent QTextDocument to highlight.

Return type:

None

highlightBlock(text)[source]

Apply highlighting to a block of text.

Parameters:

text (str | None) – The text block to highlight.

Return type:

None

class SandboxConfigDialog[source]

Bases: QDialog

Dialog for configuring Windows Sandbox.

Allows users to configure sandbox isolation settings, resource limits, network access, and shared folders.

Variables:
  • settings_updated (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when settings change.

  • CONFIG_DIR (ClassVar[Path]) – Path to the application configuration directory.

  • CONFIG_FILE (ClassVar[Path]) – Path to the sandbox JSON configuration file.

CONFIG_DIR: ClassVar[Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/intellicrack/checkouts/latest/.intellicrack')
CONFIG_FILE: ClassVar[Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/intellicrack/checkouts/latest/.intellicrack/sandbox.json')
__init__(sandbox_manager=None, parent=None)[source]

Initialize the SandboxConfigDialog with an optional sandbox manager.

Parameters:
  • sandbox_manager (SandboxManager | None) – Sandbox manager for creating and controlling sandbox instances.

  • parent (QWidget | None) – Parent widget.

Return type:

None

closeEvent(a0)[source]

Cancel any in-flight sandbox test before the dialog closes.

Parameters:

a0 (QCloseEvent | None) – The close event.

Return type:

None

reject()[source]

Cancel any in-flight sandbox test before rejecting the dialog.

Return type:

None

get_settings()[source]

Get current settings as a dictionary.

Returns:

Dictionary of current settings.

Return type:

dict[str, object]

is_sandbox_available()[source]

Check if sandbox is available.

Returns:

True if sandbox is available.

Return type:

bool

class SandboxMonitorWidget[source]

Bases: QFrame

Widget for monitoring active sandbox sessions.

Displays information about running sandbox instances and allows control over them.

Variables:

sandbox_stopped (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when sandbox is stopped.

__init__(sandbox_manager=None, parent=None)[source]

Initialize the SandboxMonitorWidget with an optional sandbox manager.

Parameters:
  • sandbox_manager (SandboxManager | None) – Sandbox manager instance for monitoring.

  • parent (QWidget | None) – Parent widget.

Return type:

None

set_running(*, is_running, binary_name='', pid=None)[source]

Update the running state display.

Parameters:
  • is_running (bool) – Whether sandbox is currently running.

  • binary_name (str) – Name of binary being executed.

  • pid (int | None) – Process ID of the sandbox.

Return type:

None

append_output(text)[source]

Append text to the output display.

Parameters:

text (str) – Text to append.

Return type:

None

class SessionManagerDialog[source]

Bases: QDialog

Dialog for managing analysis sessions.

Allows users to: - View list of saved sessions - Load previous sessions - Save current session - Delete old sessions - Export/import sessions

Variables:
  • session_loaded (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when a session is loaded.

  • session_deleted (ClassVar[PyQt6.QtCore.pyqtSignal]) – Signal emitted when a session is deleted.

  • SESSIONS_DIR (ClassVar[Path]) – Directory where serialized session files are stored.

SESSIONS_DIR: ClassVar[Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/intellicrack/checkouts/latest/.intellicrack/sessions')
__init__(session_manager=None, current_session_id=None, parent=None, current_session=None)[source]

Initialize the SessionManagerDialog with session state.

Parameters:
  • session_manager (SessionManager | None) – Session manager for loading and saving sessions.

  • current_session_id (str | None) – ID of the currently active session. When omitted but current_session is supplied, this is derived from current_session.id so the active-session-protection guard and the bold row highlighting always agree with the session actually wired into the Tags panel.

  • parent (QWidget | None) – Parent widget.

  • current_session (Session | None) – Currently active in-memory Session instance, when known. When supplied, the tag chips widget is wired directly to this session so add/remove operations mutate the live session object.

Return type:

None

classmethod from_orchestrator(orchestrator, parent=None)[source]

Build a dialog wired to orchestrator’s live session manager and active session.

Reads the SessionManager and active Session off orchestrator so callers do not need to reach into orchestrator internals themselves. This keeps the dialog backed by the same SQLite-backed SessionStore the rest of the application uses instead of silently falling back to the on-disk sidecar store, and ensures the active-session-protection guard and the tags editor are wired to the true active session rather than being permanently disabled.

Parameters:
  • orchestrator (Orchestrator) – Orchestrator instance whose session manager and active session should be used to construct the dialog.

  • parent (QWidget | None) – Parent widget.

Returns:

Dialog instance wired to orchestrator’s live session manager and active session.

Return type:

SessionManagerDialog

get_selected_session_id()[source]

Get the ID of the currently selected session.

Returns:

Selected session ID or None.

Return type:

str | None

final class SplashScreen[source]

Bases: QSplashScreen

Custom splash screen with animated gradient, glow effects, and pipeline indicator.

Displays the Intellicrack splash image during application startup with real-time progress updates, animated visual effects, and a multi-phase pipeline loading indicator.

Variables:

progress_updated – Qt signal emitted on progress change with (value, message).

__init__(version='')[source]

Initialize the SplashScreen with the given version string.

Parameters:

version (str) – Application version string to display.

Return type:

None

static compute_dpi_scale()[source]

Compute DPI scale factor from the primary screen.

Returns:

DPI scale factor (defaults to 1.0 if unavailable).

Return type:

float

static load_splash_pixmap(width, height, dpi_scale)[source]

Load the splash screen image or create fallback.

Parameters:
  • width (int) – Target pixmap width.

  • height (int) – Target pixmap height.

  • dpi_scale (float) – DPI scale factor.

Returns:

QPixmap for the splash screen.

Return type:

QPixmap

static create_fallback_pixmap(width, height, dpi_scale)[source]

Create a fallback splash screen pixmap.

Parameters:
  • width (int) – Pixmap width.

  • height (int) – Pixmap height.

  • dpi_scale (float) – DPI scale factor for font sizing.

Returns:

QPixmap with generated splash screen.

Return type:

QPixmap

show_animated()[source]

Show the splash screen with a fade-in animation and start visual effects.

Return type:

None

finish_animated(window)[source]

Finish the splash screen with a fade-out animation.

Parameters:

window (QWidget) – Main window to show after fade-out completes.

Return type:

None

mark_stage_failed(stage_index)[source]

Mark a pipeline stage as failed.

Parameters:

stage_index (int) – Index of the stage to mark (0-7).

Return type:

None

set_progress(value, message='')[source]

Update the progress bar and status message.

Parameters:
  • value (int) – Progress value (0-100).

  • message (str) – Status message to display.

Return type:

None

paintEvent(a0)[source]

Render all splash screen visual layers.

Parameters:

a0 (QPaintEvent | None) – Paint event from Qt.

Return type:

None

resizeEvent(a0)[source]

Handle resize events to adjust the overlay geometry.

Parameters:

a0 (QResizeEvent | None) – Resize event from Qt.

Return type:

None

property progress: int

Current progress value.

Returns:

Current progress (0-100).

Return type:

int

property status: str

Current status message.

Returns:

Current status message.

Return type:

str

property status_label: QLabel

Hidden status label widget retained for backward compatibility.

The status text is painted by paintEvent(); this label keeps the same text for callers that read it and is never shown.

Returns:

The hidden status label widget (retained for backward compatibility).

Return type:

QLabel

property dpi_scale: float

DPI scale factor used for this splash screen.

Returns:

DPI scale factor used for this splash screen.

Return type:

float

property version: str

Version string displayed on the splash screen.

Returns:

Version string displayed on the splash screen.

Return type:

str

class ThemeManager[source]

Bases: object

Singleton theme manager for application styling.

Manages theme loading, switching, and application-wide stylesheet management.

__init__()[source]

Initialize the ThemeManager instance.

Return type:

None

classmethod get_instance()[source]

Get the singleton instance of ThemeManager.

Returns:

The ThemeManager singleton instance.

Return type:

ThemeManager

classmethod reset_instance()[source]

Reset the singleton instance (primarily for testing).

Return type:

None

release()[source]

Release live OS color-scheme tracking held by this manager.

Disconnects the colorSchemeChanged subscription created for the "system" theme. Safe to call when no subscription is active.

Return type:

None

property theme_changed: pyqtBoundSignal

Signal emitted with the resolved theme name on every theme change.

Connect to this to refresh widgets that cannot be styled purely through the application stylesheet (custom-painted views, cached icon colors, syntax highlighters). The payload is the resolved theme name (THEME_DARK or THEME_LIGHT), never "system".

Returns:

The bound theme_changed signal.

Return type:

pyqtBoundSignal

classmethod detect_system_theme()[source]

Detect the operating system’s active light/dark preference.

Prefers Qt’s cross-platform QStyleHints.colorScheme(), which on Windows tracks the system app color mode. Falls back to a direct Windows registry read and finally to DEFAULT_THEME.

Returns:

THEME_LIGHT or THEME_DARK.

Return type:

str

classmethod resolve_theme(theme)[source]

Resolve a requested theme name to a concrete theme.

Parameters:

theme (str) – Requested theme name ("dark", "light", "dark2", "light2" or "system").

Returns:

The concrete theme to render: one of THEME_DARK, THEME_LIGHT, THEME_DARK2 or THEME_LIGHT2. "system" resolves to dark or light; unknown names resolve to DEFAULT_THEME.

Return type:

str

apply_theme(theme='dark')[source]

Apply a theme to the application.

Parameters:

theme (str) – Requested theme name ("dark", "light", "dark2", "light2" or "system"). "system" follows the OS light/dark preference and keeps tracking live OS changes.

Returns:

True if theme was applied successfully.

Return type:

bool

repolish_if_stale(widget)[source]

Repolish a chrome widget if it predates the current styled generation.

Called from _LazyChromeRepolishFilter when a previously hidden chrome widget is shown. A widget already tagged with the current generation (because it was visible and eagerly repolished during the most recent apply_theme, or already lazily repolished on an earlier Show within the same generation) is left untouched.

Parameters:

widget (QWidget) – The chrome widget that was just shown.

Return type:

None

get_stylesheet(theme)[source]

Get the stylesheet for a theme.

Parameters:

theme (str) – Theme name.

Returns:

CSS stylesheet string.

Return type:

str

toggle_theme()[source]

Toggle between light and dark within the current theme family.

Flips dark <-> light and the restyled dark2 <-> light2, so a user who selected a restyled variant stays in that family instead of dropping back to the base themes.

Returns:

The new theme name.

Return type:

str

property current_theme: str

The resolved theme name currently rendered.

Returns:

The concrete theme being displayed (THEME_DARK or THEME_LIGHT), never "system".

Return type:

str

property requested_theme: str

The theme the user requested.

Returns:

The requested theme name, which may be "system" when the theme follows the OS preference.

Return type:

str

is_dark_theme()[source]

Check if current theme is dark.

Returns:

True if dark theme is active.

Return type:

bool

get_analysis_colors(theme=None)[source]

Get the general semantic colors and disassembly token colors of a theme.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Mapping of semantic color names to QColor instances.

Return type:

dict[str, QColor]

get_hex_editor_colors(theme=None)[source]

Get the colors the hex editor grid, minimap and color modes paint with.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Colors for every hex editor role.

Return type:

HexEditorColors

get_chart_colors(theme=None)[source]

Get the colors of the entropy graph, byte histogram and digram heat map.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Colors for every chart role.

Return type:

ChartColors

get_graph_colors(theme=None)[source]

Get the colors of the control-flow graph view.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Colors for every graph role.

Return type:

GraphColors

get_stack_colors(theme=None)[source]

Get the text colors of the call-stack table.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Colors for every stack-table role.

Return type:

StackColors

get_credential_source_colors(theme=None)[source]

Get the colors that say where a provider credential comes from.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Colors for every credential-source role.

Return type:

CredentialSourceColors

get_hex_mark_colors(theme=None)[source]

Get the default colors of marks the hex editor stores in a document.

Parameters:

theme (str | None) – Theme name, or None for the theme currently rendered.

Returns:

Default #RRGGBB strings for every kind of mark.

Return type:

HexMarkColors

static get_splash_colors()[source]

Get the colors of the startup splash screen.

The splash always renders on its own dark background, so these are the dark theme’s entries whatever theme is active. It needs no ThemeManager instance and no applied theme, so the splash can call it before the application is styled.

Returns:

Colors for every splash role.

Return type:

SplashColors

static contrasting_text_color(background)[source]

Return black or white, whichever reads better on a solid background.

Parameters:

background (QColor) – Solid color the text is painted over.

Returns:

Black for light backgrounds and white for dark ones, chosen by perceived (Rec. 601) relative luminance.

Return type:

QColor

clear_cache()[source]

Clear the stylesheet cache.

Return type:

None

static get_available_themes()[source]

Get list of available theme names.

Returns:

List of theme names, including the restyled "dark2" and "light2" variants and the "system" option that follows the OS light/dark preference.

Return type:

list[str]

class ToolConfigDialog[source]

Bases: QDialog

Dialog for configuring reverse engineering tools.

Allows users to: - Configure tool installation paths - Enable/disable specific tools - Set startup timeouts - Install missing tools - Test tool connections

Variables:

tool_updated (PyQt6.QtCore.pyqtSignal) – Signal emitted when a tool config changes.

__init__(tool_registry=None, tools_directory=None, parent=None)[source]

Initialize the ToolConfigDialog.

Parameters:
  • tool_registry (ToolRegistry | None) – Optional registry of available analysis tools.

  • tools_directory (Path | None) – Optional base directory for tool installations.

  • parent (QWidget | None) – Parent widget.

Return type:

None

get_settings()[source]

Get all tool settings.

Returns:

Dictionary mapping tool IDs to their settings.

Return type:

dict[str, dict[str, Any]]

class ToolConfirmationDialog[source]

Bases: QDialog

Dialog for confirming tool calls.

Displays the tool name, function, originating source, and arguments for user review before executing potentially destructive operations.

Emits decision_made(approved: bool, remember_similar: bool) when the user accepts or rejects the call. Callers may connect to this signal to react to the decision instead of polling properties after exec().

The user chooses how long their answer applies: just this once, for the rest of the session, or always. A session answer is cached at class scope; an always answer is written to the installed approval store and survives a restart. Either way the key carries the tool’s generation, so a server that changes its tool definitions invalidates what was remembered about the old ones. Subsequent dialog instances for a remembered key short-circuit via exec(): they replay the cached decision through decision_made and finish immediately without presenting UI.

__init__(call, parent=None, *, generation=None, source_label=None)[source]

Initialize the ToolConfirmationDialog with the given tool call.

Parameters:
  • call (ToolCall) – The tool call to confirm.

  • parent (QWidget | None) – Parent widget.

  • generation (str | None) – Digest of the source’s current tool definitions, for an externally-sourced tool. None for a bridge tool.

  • source_label (str | None) – Human-readable origin of the tool, e.g. "MCP server 'files'". None for a bridge tool.

Return type:

None

classmethod set_approval_store(store)[source]

Install the store that persists always answers.

Until one is installed the dialog does not offer always at all, rather than offering it and quietly downgrading the answer to a session-scoped one.

Parameters:

store (ApprovalStore | None) – The store to write persistent answers to, or None to remove the current one.

Return type:

None

classmethod release_approval_store(store)[source]

Remove an installed store, unless another has replaced it since.

Parameters:

store (ApprovalStore) – The store its owner is withdrawing.

Return type:

None

classmethod remembered_decision(call, generation=None)[source]

Return the remembered decision for call, if any.

The session cache is consulted first, then the persistent store.

Parameters:
  • call (ToolCall) – The tool call to look up.

  • generation (str | None) – Digest of the source’s current tool definitions, or None for a bridge tool.

Returns:

True for remembered approval, False for remembered denial, or None when no decision is cached for the (tool_name, function_name, generation) triple.

Return type:

bool | None

classmethod can_remember_always(generation)[source]

Report whether an answer about a tool may be kept across restarts.

Parameters:

generation (str | None) – Digest of the source’s current tool definitions, or None for a bridge tool.

Returns:

True only when a persistent store is installed and the tool has a generation that a change would invalidate.

Return type:

bool

classmethod session_decisions()[source]

List every answer remembered for the rest of this session.

Returns:

(tool_name, function_name, generation, approved) for each answer, sorted.

Return type:

list[tuple[str, str, str | None, bool]]

classmethod forget_decision(tool_name, function_name, generation)[source]

Forget one remembered answer, for this session and for good.

Parameters:
  • tool_name (str) – The tool namespace the answer was about.

  • function_name (str) – The function the answer was about.

  • generation (str | None) – The generation it was recorded under, or None for a bridge tool.

Returns:

True when anything was forgotten.

Return type:

bool

classmethod clear_remembered_decisions()[source]

Clear all session-remembered decisions.

Intended for end-of-session teardown and test isolation. Persistent always answers are left alone, which is what makes them persistent.

Return type:

None

classmethod clear_decisions_for_source(namespace)[source]

Forget every decision remembered for one tool source.

Called when a source’s tool definitions change, so an answer given about the previous definitions is never replayed against the new ones.

Parameters:

namespace (str) – The source’s tool namespace, e.g. mcp-files.

Return type:

None

classmethod store_decision(call, *, approved, generation=None, scope=ApprovalScope.SESSION)[source]

Persist a remembered decision for the requested duration.

Parameters:
  • call (ToolCall) – The tool call whose decision is being remembered.

  • approved (bool) – True if the user approved, False if denied.

  • generation (str | None) – Digest of the source’s current tool definitions, or None for a bridge tool.

  • scope (ApprovalScope) – How long the answer applies. ONCE records nothing.

Return type:

None

property approved: bool

Whether the call was approved.

Returns:

True if user approved, False otherwise.

Return type:

bool

property remember_similar: bool

Whether to remember the choice for similar operations.

Returns:

True if the chosen scope outlives this single call.

Return type:

bool

property scope: ApprovalScope

How long the user’s answer applies.

Returns:

The scope the user selected.

Return type:

ApprovalScope

exec()[source]

Show the dialog modally, honoring any remembered decision.

If the user previously approved or denied this (tool_name, function_name, generation) triple with a scope that outlives the call, no UI is shown: the cached decision is replayed via the decision_made signal and the dialog finishes immediately with the same accepted/rejected result code as a normal execution.

Returns:

QDialog.DialogCode.Accepted on approval, otherwise QDialog.DialogCode.Rejected.

Return type:

int

set_remember_similar(*, value)[source]

Set the session-scope option programmatically.

Parameters:

value (bool) – True to remember the answer for this session, False to apply it to this call only.

Return type:

None

set_scope(scope)[source]

Select an approval scope programmatically.

Parameters:

scope (ApprovalScope) – The scope to select. ALWAYS is ignored when no persistent store is installed, or for a bridge tool whose answer nothing could ever invalidate.

Return type:

None

make_decision(*, approved)[source]

Apply an approve/deny decision and emit the corresponding signal.

This is the single entry point used by both the Approve and Deny button slots. It captures the selected scope, persists the answer for that scope, emits decision_made, and finalises the dialog with accept() or reject().

Parameters:

approved (bool) – True when the user approved the call, False when the user denied it.

Return type:

None

class ToolOutputPanel[source]

Bases: _ToolOutputPanelWiringMixin

Main tool output panel widget.

Contains tabbed interface for different tool outputs including decompiled code, disassembly, strings, cross-references, embedded external tools, and specialized analysis panels.

Composed from the _ToolOutputPanelBase core class together with topical mixin classes that inherit linearly so cross-references resolve through normal MRO. Each mixin groups one surface area so no single class definition exceeds the public method limit.

class ToolSettingsWidget[source]

Bases: QFrame

Widget for configuring a single tool.

Displays path configuration, enable/disable toggle, and installation options for a specific tool.

Variables:

status_changed (PyQt6.QtCore.pyqtSignal) – Signal emitted when tool status changes.

__init__(tool_id, display_name, description, tools_directory, registry=None, config_path=None, parent=None)[source]

Initialize the ToolSettingsWidget for a single tool.

Parameters:
  • tool_id (str) – Identifier of the tool.

  • display_name (str) – Human-readable name for display.

  • description (str) – Tool description text.

  • tools_directory (Path) – Base directory for tool installations.

  • registry (ToolRegistry | None) – Optional tool registry for status queries.

  • config_path (Path | None) – Optional path to the tool configuration file.

  • parent (QWidget | None) – Parent widget.

Return type:

None

get_settings()[source]

Get current settings as a dictionary.

Returns:

Dictionary of current settings.

Return type:

dict[str, Any]

save_settings()[source]

Save current settings to config file.

Return type:

None

class ToolStatusDialog[source]

Bases: QDialog

Dialog showing status and capabilities of all configured tools.

Displays which tools are installed, their connection state, supported capabilities, architectures, and file formats.

Variables:

TOOL_CAPABILITIES (ClassVar[dict[str, dict[str, Any]]]) – Mapping of tool IDs to their supported features, architectures, and formats.

TOOL_CAPABILITIES: ClassVar[dict[str, dict[str, Any]]] = {'binary': {'architectures': ['x86', 'x86_64', 'ARM', 'ARM64'], 'formats': ['PE', 'ELF', 'Mach-O', 'Raw'], 'supports_debugging': False, 'supports_decompilation': False, 'supports_dynamic_analysis': False, 'supports_memory_access': False, 'supports_patching': True, 'supports_scripting': False, 'supports_static_analysis': True}, 'cutter': {'architectures': ['x86', 'x86_64', 'ARM', 'ARM64', 'MIPS', 'PPC', 'SPARC'], 'formats': ['PE', 'ELF', 'Mach-O', 'Raw', 'DEX'], 'supports_debugging': False, 'supports_decompilation': True, 'supports_dynamic_analysis': False, 'supports_memory_access': False, 'supports_patching': True, 'supports_scripting': True, 'supports_static_analysis': True}, 'frida': {'architectures': ['x86', 'x86_64', 'ARM', 'ARM64'], 'formats': ['PE', 'ELF', 'Mach-O'], 'supports_debugging': False, 'supports_decompilation': False, 'supports_dynamic_analysis': True, 'supports_memory_access': True, 'supports_patching': False, 'supports_scripting': True, 'supports_static_analysis': False}, 'ghidra': {'architectures': ['x86', 'x86_64', 'ARM', 'ARM64', 'MIPS', 'PPC'], 'formats': ['PE', 'ELF', 'Mach-O', 'Raw'], 'supports_debugging': False, 'supports_decompilation': True, 'supports_dynamic_analysis': False, 'supports_memory_access': False, 'supports_patching': True, 'supports_scripting': True, 'supports_static_analysis': True}, 'process': {'architectures': ['x86', 'x86_64'], 'formats': [], 'supports_debugging': False, 'supports_decompilation': False, 'supports_dynamic_analysis': True, 'supports_memory_access': True, 'supports_patching': False, 'supports_scripting': False, 'supports_static_analysis': False}, 'x64dbg': {'architectures': ['x86', 'x86_64'], 'formats': ['PE'], 'supports_debugging': True, 'supports_decompilation': False, 'supports_dynamic_analysis': True, 'supports_memory_access': True, 'supports_patching': True, 'supports_scripting': True, 'supports_static_analysis': False}}
__init__(tool_registry=None, parent=None, tool_statuses=None)[source]

Initialize the ToolStatusDialog.

Parameters:
  • tool_registry (ToolRegistry | None) – Optional registry of available analysis tools.

  • parent (QWidget | None) – Parent widget.

  • tool_statuses (dict[str, ToolStatusEntry] | None) – Optional mapping of tool IDs to pre-fetched ToolStatusEntry payloads. When provided, the dialog renders the supplied status snapshot immediately and skips the initial background status-check workers. Subsequent refreshes triggered by explicit user action (e.g. the Refresh button) always re-run the workers.

Return type:

None

class ToolTab[source]

Bases: QFrame

A single tool output tab.

Contains a code display area and optional metadata panel for showing tool-specific output.

__init__(name, language='c', parent=None)[source]

Initialize the ToolTab with a name and language for output display.

Parameters:
  • name (str) – Tab name for identification and display.

  • language (str) – Programming language for syntax highlighting.

  • parent (QWidget | None) – Parent widget.

Return type:

None

set_content(content)[source]

Set the main content.

Parameters:

content (str) – Text content to display.

Return type:

None

set_info(header, content)[source]

Set the info panel content.

Parameters:
  • header (str) – Info header text.

  • content (str) – Info content text.

Return type:

None

set_language(language)[source]

Set the syntax highlighting language.

Parameters:

language (str) – Programming language.

Return type:

None

goto_line(line_number)[source]

Scroll to a specific line.

Parameters:

line_number (int) – 1-based line number.

Return type:

None

append_content(content)[source]

Append content to the display.

Parameters:

content (str) – Text content to append.

Return type:

None

class XRefPanel[source]

Bases: QFrame

Panel showing cross-references to/from an address.

Displays incoming and outgoing references for navigation.

Variables:

xref_selected – Qt signal for xref selected. Declared as qint64 (not the default 32-bit C++ int) so that 64-bit virtual addresses are not truncated when emitted.

__init__(parent=None)[source]

Initialize the XRefPanel.

Parameters:

parent (QWidget | None) – Parent widget.

Return type:

None

set_xrefs(incoming, outgoing)[source]

Set the cross-reference data.

Parameters:
  • incoming (list[tuple[int, str]]) – List of (address, description) for refs to this location.

  • outgoing (list[tuple[int, str]]) – List of (address, description) for refs from this location.

Return type:

None

format_hex_dump(data, base_address, *, address_prefix='')[source]

Format raw bytes as a 16-byte-per-line hex+ASCII dump.

Each line contains the absolute address followed by up to sixteen hexadecimal byte values and the printable-ASCII representation of that chunk. Bytes outside the [0x20, 0x7F) printable range are shown as ..

Parameters:
  • data (bytes) – Raw bytes to render.

  • base_address (int) – Address corresponding to data[0]; subsequent line addresses are computed as base_address + offset.

  • address_prefix (str) – Optional prefix prepended to each address column (for example "0x"). Defaults to an empty string.

Returns:

The formatted hex dump joined by newlines. Returns an empty string when data is empty.

Return type:

str

get_assets_path()[source]

Get the path to the assets directory.

Returns:

Path to the assets directory.

Return type:

Path

Raises:

AssetNotFoundError – If the assets directory cannot be found.

get_highlighter_for_language(language, parent=None)[source]

Get the appropriate syntax highlighter for a language.

Parameters:
  • language (str) – Language name (c, cpp, asm, python, javascript, frida, hexpat, pattern, hexpattern).

  • parent (QTextDocument | None) – Parent QTextDocument.

Returns:

Appropriate highlighter or None if not supported.

Return type:

QSyntaxHighlighter | None

get_resource_path(resource_path)[source]

Resolve a resource path relative to the assets directory.

Parameters:

resource_path (str) – Relative path to the resource within assets directory. Forward slashes are automatically converted to OS-specific separators.

Returns:

Absolute path to the resource.

Return type:

Path

Example

>>> path = get_resource_path("icons/status_success.svg")
>>> print(path)
/path/to/intellicrack/assets/icons/status_success.svg

Submodules

app

Main application window for Intellicrack.

chat

Chat panel widget for the Intellicrack UI.

confirmation_dialog

Tool confirmation dialog for Intellicrack.

dialogs

Dialog components for Intellicrack UI.

dialogs_helpers

Shared dialog helpers for Intellicrack UI panels.

guest_process_picker

Guest process picker dialog for sandbox memory-dump target selection.

highlighter

Syntax highlighting for code display.

log_viewer

Live log viewer package.

mcp_bridge

Carries an MCP server's questions from the background loop to the operator.

mcp_config

Settings for third-party Model Context Protocol servers.

mcp_consent_dialog

Consent dialog shown before a local Model Context Protocol server is started.

mcp_context_browser

Browse a running server's resources and prompts from the chat, and insert them into the message being written.

mcp_elicitation_dialog

Dialog answering an MCP server's request for information from the operator.

mcp_roots_view

The Roots tab of MCP Settings: which folders one server is told it may work in.

mcp_service

Assembles the Model Context Protocol client for the running application.

overflow_toolbar

Overflow-aware QToolBar for Intellicrack's main toolbar.

panel_dock

Detachable panel window for floating tool panels.

panels

UI panels for Intellicrack analysis displays.

preferences

Preferences dialog for Intellicrack.

provider_config

Provider configuration dialog for Intellicrack.

resources

Resource management modules for Intellicrack UI.

sandbox_config

Sandbox configuration dialog for Intellicrack.

session_manager

Session manager dialog for Intellicrack.

tool_activity

The tool calls running now, shown beside the conversation with their progress and a way to cancel each one.

tool_config

Tool configuration dialog for Intellicrack.

tools

Tool output panel widget for the Intellicrack UI.

win32_embed

Win32 window embedding utilities for Intellicrack.

xpu_status

XPU status dialog for the Help menu.