Private
Public Access
0
0

more app controller org

This commit is contained in:
2026-06-07 02:47:00 -04:00
parent 727f44d57e
commit c039fdbb20
3 changed files with 834 additions and 860 deletions
+794 -818
View File
File diff suppressed because it is too large Load Diff
+38 -38
View File
@@ -107,11 +107,11 @@ from src import cost_tracker
from src import history
from src import imgui_scopes as imscope
from src import paths
from src import presets
# from src import presets
from src import project_manager
from src import session_logger
from src import log_registry
from src import log_pruner
# from src import log_pruner
from src import models
from src.models import GenerateRequest, ConfirmRequest
from src import mcp_client
@@ -140,11 +140,11 @@ def hide_tk_root() -> Tk:
# Standard Color Constants (now bound to the theming system)
def C_OUT() -> imgui.ImVec4: return theme.get_color("status_info")
def C_IN() -> imgui.ImVec4: return theme.get_color("status_success")
def C_IN() -> imgui.ImVec4: return theme.get_color("status_success")
def C_REQ() -> imgui.ImVec4: return theme.get_color("status_warning")
def C_RES() -> imgui.ImVec4: return theme.get_color("status_success")
def C_TC() -> imgui.ImVec4: return theme.get_color("status_warning")
def C_TR() -> imgui.ImVec4: return theme.get_color("status_info")
def C_TC() -> imgui.ImVec4: return theme.get_color("status_warning")
def C_TR() -> imgui.ImVec4: return theme.get_color("status_info")
def C_TRS() -> imgui.ImVec4: return theme.get_color("status_info")
def C_LBL() -> imgui.ImVec4: return theme.get_color("text_disabled")
def C_VAL() -> imgui.ImVec4: return theme.get_color("text")
@@ -702,34 +702,34 @@ class App:
from src import history
import copy
return history.UISnapshot(
ai_input=self.ui_ai_input,
project_system_prompt=self.ui_project_system_prompt,
global_system_prompt=self.ui_global_system_prompt,
base_system_prompt=self.ui_base_system_prompt,
use_default_base_prompt=self.ui_use_default_base_prompt,
temperature=self.temperature,
top_p=self.top_p,
max_tokens=self.max_tokens,
auto_add_history=self.ui_auto_add_history,
disc_entries=copy.deepcopy(self.disc_entries),
files=[f.to_dict() if hasattr(f, 'to_dict') else f for f in self.files],
context_files=[f.to_dict() if hasattr(f, 'to_dict') else f for f in self.context_files],
screenshots=list(self.screenshots)
ai_input = self.ui_ai_input,
project_system_prompt = self.ui_project_system_prompt,
global_system_prompt = self.ui_global_system_prompt,
base_system_prompt = self.ui_base_system_prompt,
use_default_base_prompt = self.ui_use_default_base_prompt,
temperature = self.temperature,
top_p = self.top_p,
max_tokens = self.max_tokens,
auto_add_history = self.ui_auto_add_history,
disc_entries = copy.deepcopy(self.disc_entries),
files = [f.to_dict() if hasattr(f, 'to_dict') else f for f in self.files],
context_files = [f.to_dict() if hasattr(f, 'to_dict') else f for f in self.context_files],
screenshots = list(self.screenshots)
)
def _apply_snapshot(self, snapshot: history.UISnapshot) -> None:
self._is_applying_snapshot = True
try:
self.ui_ai_input = snapshot.ai_input
self.ui_project_system_prompt = snapshot.project_system_prompt
self.ui_global_system_prompt = snapshot.global_system_prompt
self.ui_base_system_prompt = snapshot.base_system_prompt
self.ui_ai_input = snapshot.ai_input
self.ui_project_system_prompt = snapshot.project_system_prompt
self.ui_global_system_prompt = snapshot.global_system_prompt
self.ui_base_system_prompt = snapshot.base_system_prompt
self.ui_use_default_base_prompt = snapshot.use_default_base_prompt
self.temperature = snapshot.temperature
self.top_p = snapshot.top_p
self.max_tokens = snapshot.max_tokens
self.ui_auto_add_history = snapshot.auto_add_history
self.disc_entries = snapshot.disc_entries
self.temperature = snapshot.temperature
self.top_p = snapshot.top_p
self.max_tokens = snapshot.max_tokens
self.ui_auto_add_history = snapshot.auto_add_history
self.disc_entries = snapshot.disc_entries
# Restore files as FileItem objects
from src import models
@@ -762,18 +762,18 @@ class App:
except Exception:
ini = ""
panel_states = {
"ui_separate_context_preview": getattr(self, "ui_separate_context_preview", False),
"ui_separate_message_panel": getattr(self, "ui_separate_message_panel", False),
"ui_separate_response_panel": getattr(self, "ui_separate_response_panel", False),
"ui_separate_context_preview": getattr(self, "ui_separate_context_preview", False),
"ui_separate_message_panel": getattr(self, "ui_separate_message_panel", False),
"ui_separate_response_panel": getattr(self, "ui_separate_response_panel", False),
"ui_separate_tool_calls_panel": getattr(self, "ui_separate_tool_calls_panel", False),
"ui_separate_task_dag": getattr(self, "ui_separate_task_dag", False),
"ui_separate_usage_analytics": getattr(self, "ui_separate_usage_analytics", False),
"ui_separate_tier1": getattr(self, "ui_separate_tier1", False),
"ui_separate_tier2": getattr(self, "ui_separate_tier2", False),
"ui_separate_tier3": getattr(self, "ui_separate_tier3", False),
"ui_separate_tier4": getattr(self, "ui_separate_tier4", False),
"ui_separate_external_tools": getattr(self, "ui_separate_external_tools", False),
"ui_discussion_split_h": getattr(self, "ui_discussion_split_h", 300.0),
"ui_separate_task_dag": getattr(self, "ui_separate_task_dag", False),
"ui_separate_usage_analytics": getattr(self, "ui_separate_usage_analytics", False),
"ui_separate_tier1": getattr(self, "ui_separate_tier1", False),
"ui_separate_tier2": getattr(self, "ui_separate_tier2", False),
"ui_separate_tier3": getattr(self, "ui_separate_tier3", False),
"ui_separate_tier4": getattr(self, "ui_separate_tier4", False),
"ui_separate_external_tools": getattr(self, "ui_separate_external_tools", False),
"ui_discussion_split_h": getattr(self, "ui_discussion_split_h", 300.0),
}
return models.WorkspaceProfile(
name=name,
+2 -4
View File
@@ -1304,10 +1304,8 @@ def get_external_mcp_manager() -> ExternalMCPManager:
def dispatch(tool_name: str, tool_input: dict[str, Any]) -> str:
"""
Dispatch an MCP tool call by name. Returns the result as a string.
[C: tests/test_gemini_cli_edge_cases.py:test_gemini_cli_parameter_resilience, tests/test_mcp_client_beads.py:test_bd_mcp_tools, tests/test_mcp_ts_integration.py:test_ts_c_get_code_outline_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_signature_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_skeleton_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_update_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_code_outline_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_signature_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_skeleton_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_update_definition_dispatch, tests/test_py_struct_tools.py:test_mcp_dispatch_errors, tests/test_py_struct_tools.py:test_mcp_dispatch_integration]
Dispatch an MCP tool call by name. Returns the result as a string.
[C: tests/test_gemini_cli_edge_cases.py:test_gemini_cli_parameter_resilience, tests/test_mcp_client_beads.py:test_bd_mcp_tools, tests/test_mcp_ts_integration.py:test_ts_c_get_code_outline_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_signature_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_get_skeleton_dispatch, tests/test_mcp_ts_integration.py:test_ts_c_update_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_code_outline_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_definition_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_signature_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_get_skeleton_dispatch, tests/test_mcp_ts_integration.py:test_ts_cpp_update_definition_dispatch, tests/test_py_struct_tools.py:test_mcp_dispatch_errors, tests/test_py_struct_tools.py:test_mcp_dispatch_integration]
"""
# Handle aliases
path = str(tool_input.get("path", tool_input.get("file_path", tool_input.get("dir_path", ""))))