intellicrack.ui.app

Main application window for Intellicrack.

This module provides the main PyQt6 application window that combines all UI components and connects them to the orchestrator.

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