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:
QMainWindowMain 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
QWindowhandle until it is shown for the first time, so thescreenChangedconnection (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, sorecord_executionfinds nothing to record against and the run is dropped.
- 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 optionalSandboxManager) so the sandbox tab, chat workflow, and AI bridges can drive it. Whenmanageris supplied it replaces the lazy manager on the resultingSandboxBridge; otherwise the bridge constructs its own. The supplied manager (or the bridge’s lazily created one) is also installed on the window assandbox_managerso the sandbox configuration dialog and teardown paths see the same instance the panel sees.- Parameters:
sandbox (SandboxBase) – Pre-constructed
SandboxBaseimplementation.manager (SandboxManager | None) – Optional pre-constructed
SandboxManagerto install on the resulting bridge. WhenNonethe bridge’s lazy manager is used.
- Return type:
None
- set_script_generator(generator)[source]
Persist the application-scoped ScriptGenerator instance.
ScriptGeneratoris 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.
TemplateManagerowns the on-disk built-in and user template directories underconfig_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
Nonewhen it has not been constructed yet (or was disposed after the main window closed).
- Return type:
LogViewerWindow | None