|
|
@@ -114,6 +114,8 @@ class App:
|
|
|
|
self._tool_log_dirty: bool = True
|
|
|
|
self._tool_log_dirty: bool = True
|
|
|
|
self._last_ui_focus_agent: Optional[str] = None
|
|
|
|
self._last_ui_focus_agent: Optional[str] = None
|
|
|
|
self._log_registry: Optional[log_registry.LogRegistry] = None
|
|
|
|
self._log_registry: Optional[log_registry.LogRegistry] = None
|
|
|
|
|
|
|
|
self.perf_profiling_enabled = False
|
|
|
|
|
|
|
|
self.perf_profiling_enabled = False
|
|
|
|
|
|
|
|
|
|
|
|
def _handle_approve_tool(self, user_data=None) -> None:
|
|
|
|
def _handle_approve_tool(self, user_data=None) -> None:
|
|
|
|
"""UI-level wrapper for approving a pending tool execution ask."""
|
|
|
|
"""UI-level wrapper for approving a pending tool execution ask."""
|
|
|
@@ -241,6 +243,7 @@ class App:
|
|
|
|
imgui.end_menu()
|
|
|
|
imgui.end_menu()
|
|
|
|
|
|
|
|
|
|
|
|
def _gui_func(self) -> None:
|
|
|
|
def _gui_func(self) -> None:
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func")
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.perf_monitor.start_frame()
|
|
|
|
self.perf_monitor.start_frame()
|
|
|
|
self._autofocus_response_tab = self.controller._autofocus_response_tab
|
|
|
|
self._autofocus_response_tab = self.controller._autofocus_response_tab
|
|
|
@@ -342,7 +345,9 @@ class App:
|
|
|
|
exp, opened = imgui.begin("MMA Dashboard", self.show_windows["MMA Dashboard"])
|
|
|
|
exp, opened = imgui.begin("MMA Dashboard", self.show_windows["MMA Dashboard"])
|
|
|
|
self.show_windows["MMA Dashboard"] = bool(opened)
|
|
|
|
self.show_windows["MMA Dashboard"] = bool(opened)
|
|
|
|
if exp:
|
|
|
|
if exp:
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_mma_dashboard")
|
|
|
|
self._render_mma_dashboard()
|
|
|
|
self._render_mma_dashboard()
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_mma_dashboard")
|
|
|
|
imgui.end()
|
|
|
|
imgui.end()
|
|
|
|
if self.show_windows.get("Tier 1: Strategy", False):
|
|
|
|
if self.show_windows.get("Tier 1: Strategy", False):
|
|
|
|
exp, opened = imgui.begin("Tier 1: Strategy", self.show_windows["Tier 1: Strategy"])
|
|
|
|
exp, opened = imgui.begin("Tier 1: Strategy", self.show_windows["Tier 1: Strategy"])
|
|
|
@@ -376,7 +381,9 @@ class App:
|
|
|
|
if exp:
|
|
|
|
if exp:
|
|
|
|
# Top part for the history
|
|
|
|
# Top part for the history
|
|
|
|
imgui.begin_child("HistoryChild", size=(0, -200))
|
|
|
|
imgui.begin_child("HistoryChild", size=(0, -200))
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_discussion_panel")
|
|
|
|
self._render_discussion_panel()
|
|
|
|
self._render_discussion_panel()
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_discussion_panel")
|
|
|
|
imgui.end_child()
|
|
|
|
imgui.end_child()
|
|
|
|
# Bottom part with tabs for message and response
|
|
|
|
# Bottom part with tabs for message and response
|
|
|
|
# Detach controls
|
|
|
|
# Detach controls
|
|
|
@@ -472,7 +479,9 @@ class App:
|
|
|
|
imgui.end()
|
|
|
|
imgui.end()
|
|
|
|
|
|
|
|
|
|
|
|
if self.show_windows.get("Log Management", False):
|
|
|
|
if self.show_windows.get("Log Management", False):
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_log_management")
|
|
|
|
self._render_log_management()
|
|
|
|
self._render_log_management()
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_log_management")
|
|
|
|
if self.show_windows["Diagnostics"]:
|
|
|
|
if self.show_windows["Diagnostics"]:
|
|
|
|
exp, opened = imgui.begin("Diagnostics", self.show_windows["Diagnostics"])
|
|
|
|
exp, opened = imgui.begin("Diagnostics", self.show_windows["Diagnostics"])
|
|
|
|
self.show_windows["Diagnostics"] = bool(opened)
|
|
|
|
self.show_windows["Diagnostics"] = bool(opened)
|
|
|
@@ -491,6 +500,8 @@ class App:
|
|
|
|
self.perf_history["input_lag"].append(metrics.get("input_lag_ms", 0.0))
|
|
|
|
self.perf_history["input_lag"].append(metrics.get("input_lag_ms", 0.0))
|
|
|
|
metrics = self.perf_monitor.get_metrics()
|
|
|
|
metrics = self.perf_monitor.get_metrics()
|
|
|
|
imgui.text("Performance Telemetry")
|
|
|
|
imgui.text("Performance Telemetry")
|
|
|
|
|
|
|
|
imgui.same_line()
|
|
|
|
|
|
|
|
_, self.perf_profiling_enabled = imgui.checkbox("Enable Profiling", self.perf_profiling_enabled)
|
|
|
|
imgui.separator()
|
|
|
|
imgui.separator()
|
|
|
|
if imgui.begin_table("perf_table", 2, imgui.TableFlags_.borders_inner_h):
|
|
|
|
if imgui.begin_table("perf_table", 2, imgui.TableFlags_.borders_inner_h):
|
|
|
|
imgui.table_setup_column("Metric")
|
|
|
|
imgui.table_setup_column("Metric")
|
|
|
@@ -517,6 +528,66 @@ class App:
|
|
|
|
imgui.table_next_column()
|
|
|
|
imgui.table_next_column()
|
|
|
|
imgui.text(f"{metrics.get('input_lag_ms', 0.0):.1f}")
|
|
|
|
imgui.text(f"{metrics.get('input_lag_ms', 0.0):.1f}")
|
|
|
|
imgui.end_table()
|
|
|
|
imgui.end_table()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled:
|
|
|
|
|
|
|
|
imgui.separator()
|
|
|
|
|
|
|
|
imgui.text("Detailed Component Timings")
|
|
|
|
|
|
|
|
if imgui.begin_table("comp_timings", 2, imgui.TableFlags_.borders):
|
|
|
|
|
|
|
|
imgui.table_setup_column("Component")
|
|
|
|
|
|
|
|
imgui.table_setup_column("Time (ms)")
|
|
|
|
|
|
|
|
imgui.table_headers_row()
|
|
|
|
|
|
|
|
for key, val in metrics.items():
|
|
|
|
|
|
|
|
if key.startswith("time_") and key.endswith("_ms"):
|
|
|
|
|
|
|
|
comp_name = key[5:-3]
|
|
|
|
|
|
|
|
imgui.table_next_row()
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
imgui.text(comp_name)
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
if val > 10.0:
|
|
|
|
|
|
|
|
imgui.text_colored(imgui.ImVec4(1.0, 0.2, 0.2, 1.0), f"{val:.2f}")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
imgui.text(f"{val:.2f}")
|
|
|
|
|
|
|
|
imgui.end_table()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled:
|
|
|
|
|
|
|
|
imgui.separator()
|
|
|
|
|
|
|
|
imgui.text("Detailed Component Timings")
|
|
|
|
|
|
|
|
if imgui.begin_table("comp_timings", 2, imgui.TableFlags_.borders):
|
|
|
|
|
|
|
|
imgui.table_setup_column("Component")
|
|
|
|
|
|
|
|
imgui.table_setup_column("Time (ms)")
|
|
|
|
|
|
|
|
imgui.table_headers_row()
|
|
|
|
|
|
|
|
for key, val in metrics.items():
|
|
|
|
|
|
|
|
if key.startswith("time_") and key.endswith("_ms"):
|
|
|
|
|
|
|
|
comp_name = key[5:-3]
|
|
|
|
|
|
|
|
imgui.table_next_row()
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
imgui.text(comp_name)
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
if val > 10.0:
|
|
|
|
|
|
|
|
imgui.text_colored(imgui.ImVec4(1.0, 0.2, 0.2, 1.0), f"{val:.2f}")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
imgui.text(f"{val:.2f}")
|
|
|
|
|
|
|
|
imgui.end_table()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.perf_profiling_enabled:
|
|
|
|
|
|
|
|
imgui.separator()
|
|
|
|
|
|
|
|
imgui.text("Detailed Component Timings")
|
|
|
|
|
|
|
|
if imgui.begin_table("comp_timings", 2, imgui.TableFlags_.borders):
|
|
|
|
|
|
|
|
imgui.table_setup_column("Component")
|
|
|
|
|
|
|
|
imgui.table_setup_column("Time (ms)")
|
|
|
|
|
|
|
|
imgui.table_headers_row()
|
|
|
|
|
|
|
|
for key, val in metrics.items():
|
|
|
|
|
|
|
|
if key.startswith("time_") and key.endswith("_ms"):
|
|
|
|
|
|
|
|
comp_name = key[5:-3]
|
|
|
|
|
|
|
|
imgui.table_next_row()
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
imgui.text(comp_name)
|
|
|
|
|
|
|
|
imgui.table_next_column()
|
|
|
|
|
|
|
|
if val > 10.0:
|
|
|
|
|
|
|
|
imgui.text_colored(imgui.ImVec4(1.0, 0.2, 0.2, 1.0), f"{val:.2f}")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
imgui.text(f"{val:.2f}")
|
|
|
|
|
|
|
|
imgui.end_table()
|
|
|
|
imgui.separator()
|
|
|
|
imgui.separator()
|
|
|
|
imgui.text("Frame Time (ms)")
|
|
|
|
imgui.text("Frame Time (ms)")
|
|
|
|
imgui.plot_lines("##ft_plot", np.array(self.perf_history["frame_time"], dtype=np.float32), overlay_text="frame_time", graph_size=imgui.ImVec2(-1, 60))
|
|
|
|
imgui.plot_lines("##ft_plot", np.array(self.perf_history["frame_time"], dtype=np.float32), overlay_text="frame_time", graph_size=imgui.ImVec2(-1, 60))
|
|
|
@@ -1012,8 +1083,6 @@ class App:
|
|
|
|
if imgui.button("Refresh Registry"):
|
|
|
|
if imgui.button("Refresh Registry"):
|
|
|
|
self._log_registry = log_registry.LogRegistry(str(paths.get_logs_dir() / "log_registry.toml"))
|
|
|
|
self._log_registry = log_registry.LogRegistry(str(paths.get_logs_dir() / "log_registry.toml"))
|
|
|
|
imgui.same_line()
|
|
|
|
imgui.same_line()
|
|
|
|
if imgui.button("Force Prune Logs"):
|
|
|
|
|
|
|
|
self.controller.event_queue.put("gui_task", {"action": "click", "item": "btn_prune_logs"})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registry = self._log_registry
|
|
|
|
registry = self._log_registry
|
|
|
|
sessions = registry.data
|
|
|
|
sessions = registry.data
|
|
|
@@ -1068,6 +1137,8 @@ class App:
|
|
|
|
)
|
|
|
|
)
|
|
|
|
imgui.end_table()
|
|
|
|
imgui.end_table()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if imgui.button("Force Prune Logs"):
|
|
|
|
|
|
|
|
self.controller.event_queue.put("gui_task", {"action": "click", "item": "btn_prune_logs"})
|
|
|
|
imgui.end()
|
|
|
|
imgui.end()
|
|
|
|
|
|
|
|
|
|
|
|
def _render_files_panel(self) -> None:
|
|
|
|
def _render_files_panel(self) -> None:
|
|
|
@@ -1084,11 +1155,11 @@ class App:
|
|
|
|
r.destroy()
|
|
|
|
r.destroy()
|
|
|
|
if d: self.ui_files_base_dir = d
|
|
|
|
if d: self.ui_files_base_dir = d
|
|
|
|
imgui.separator()
|
|
|
|
imgui.separator()
|
|
|
|
imgui.begin_child("f_paths", imgui.ImVec2(0, 200), True)
|
|
|
|
imgui.begin_child("f_paths", imgui.ImVec2(0, -40), True)
|
|
|
|
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders | imgui.TableFlags_.scroll_x):
|
|
|
|
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders):
|
|
|
|
imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40)
|
|
|
|
imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40)
|
|
|
|
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
|
|
|
|
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
|
|
|
|
imgui.table_setup_column("Flags", imgui.TableColumnFlags_.width_fixed, 110)
|
|
|
|
imgui.table_setup_column("Flags", imgui.TableColumnFlags_.width_fixed, 150)
|
|
|
|
imgui.table_setup_column("Cache", imgui.TableColumnFlags_.width_fixed, 40)
|
|
|
|
imgui.table_setup_column("Cache", imgui.TableColumnFlags_.width_fixed, 40)
|
|
|
|
imgui.table_headers_row()
|
|
|
|
imgui.table_headers_row()
|
|
|
|
|
|
|
|
|
|
|
@@ -1146,7 +1217,7 @@ class App:
|
|
|
|
r.destroy()
|
|
|
|
r.destroy()
|
|
|
|
if d: self.ui_shots_base_dir = d
|
|
|
|
if d: self.ui_shots_base_dir = d
|
|
|
|
imgui.separator()
|
|
|
|
imgui.separator()
|
|
|
|
imgui.begin_child("s_paths", imgui.ImVec2(0, 200), True)
|
|
|
|
imgui.begin_child("s_paths", imgui.ImVec2(0, -40), True)
|
|
|
|
for i, s in enumerate(self.screenshots):
|
|
|
|
for i, s in enumerate(self.screenshots):
|
|
|
|
if imgui.button(f"x##s{i}"):
|
|
|
|
if imgui.button(f"x##s{i}"):
|
|
|
|
self.screenshots.pop(i)
|
|
|
|
self.screenshots.pop(i)
|
|
|
@@ -1619,21 +1690,21 @@ class App:
|
|
|
|
with self._send_thread_lock:
|
|
|
|
with self._send_thread_lock:
|
|
|
|
if self.send_thread and self.send_thread.is_alive():
|
|
|
|
if self.send_thread and self.send_thread.is_alive():
|
|
|
|
send_busy = True
|
|
|
|
send_busy = True
|
|
|
|
|
|
|
|
if imgui.button("Inject File"):
|
|
|
|
|
|
|
|
self.show_inject_modal = True
|
|
|
|
|
|
|
|
imgui.same_line()
|
|
|
|
if (imgui.button("Gen + Send") or ctrl_enter) and not send_busy:
|
|
|
|
if (imgui.button("Gen + Send") or ctrl_enter) and not send_busy:
|
|
|
|
self._handle_generate_send()
|
|
|
|
self._handle_generate_send()
|
|
|
|
imgui.same_line()
|
|
|
|
imgui.same_line()
|
|
|
|
if imgui.button("MD Only"):
|
|
|
|
if imgui.button("MD Only"):
|
|
|
|
self._handle_md_only()
|
|
|
|
self._handle_md_only()
|
|
|
|
imgui.same_line()
|
|
|
|
imgui.same_line()
|
|
|
|
if imgui.button("Inject File"):
|
|
|
|
if imgui.button("Reset"):
|
|
|
|
self.show_inject_modal = True
|
|
|
|
self._handle_reset_session()
|
|
|
|
imgui.same_line()
|
|
|
|
imgui.same_line()
|
|
|
|
if imgui.button("-> History"):
|
|
|
|
if imgui.button("-> History"):
|
|
|
|
if self.ui_ai_input:
|
|
|
|
if self.ui_ai_input:
|
|
|
|
self.disc_entries.append({"role": "User", "content": self.ui_ai_input, "collapsed": False, "ts": project_manager.now_ts()})
|
|
|
|
self.disc_entries.append({"role": "User", "content": self.ui_ai_input, "collapsed": False, "ts": project_manager.now_ts()})
|
|
|
|
imgui.same_line()
|
|
|
|
|
|
|
|
if imgui.button("Reset"):
|
|
|
|
|
|
|
|
self._handle_reset_session()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _render_response_panel(self) -> None:
|
|
|
|
def _render_response_panel(self) -> None:
|
|
|
|
if self._trigger_blink:
|
|
|
|
if self._trigger_blink:
|
|
|
|