feat(ui): Add UI toggles for available tools per-project
This commit is contained in:
23
gui.py
23
gui.py
@@ -589,6 +589,13 @@ class App:
|
||||
dpg.set_value("auto_add_history", proj.get("discussion", {}).get("auto_add", False))
|
||||
if dpg.does_item_exist("project_word_wrap"):
|
||||
dpg.set_value("project_word_wrap", proj.get("project", {}).get("word_wrap", True))
|
||||
|
||||
agent_tools = proj.get("agent", {}).get("tools", {})
|
||||
for t_name in ["run_powershell", "read_file", "list_directory", "search_files", "get_file_summary", "web_search", "fetch_url"]:
|
||||
tag = f"tool_toggle_{t_name}"
|
||||
if dpg.does_item_exist(tag):
|
||||
dpg.set_value(tag, agent_tools.get(t_name, True))
|
||||
|
||||
self.cb_word_wrap_toggled(app_data=proj.get("project", {}).get("word_wrap", True))
|
||||
|
||||
def _save_active_project(self):
|
||||
@@ -867,6 +874,13 @@ class App:
|
||||
if dpg.does_item_exist("project_word_wrap"):
|
||||
proj["project"]["word_wrap"] = dpg.get_value("project_word_wrap")
|
||||
|
||||
# Agent tools
|
||||
proj.setdefault("agent", {}).setdefault("tools", {})
|
||||
for t_name in ["run_powershell", "read_file", "list_directory", "search_files", "get_file_summary", "web_search", "fetch_url"]:
|
||||
tag = f"tool_toggle_{t_name}"
|
||||
if dpg.does_item_exist(tag):
|
||||
proj["agent"]["tools"][t_name] = dpg.get_value(tag)
|
||||
|
||||
# Discussion
|
||||
self._flush_disc_entries_to_project()
|
||||
disc_sec = proj.setdefault("discussion", {})
|
||||
@@ -1699,6 +1713,15 @@ class App:
|
||||
default_value=self.project.get("project", {}).get("word_wrap", True),
|
||||
callback=self.cb_word_wrap_toggled
|
||||
)
|
||||
dpg.add_separator()
|
||||
dpg.add_text("Agent Capabilities")
|
||||
agent_tools = self.project.get("agent", {}).get("tools", {})
|
||||
for t_name in ["run_powershell", "read_file", "list_directory", "search_files", "get_file_summary", "web_search", "fetch_url"]:
|
||||
dpg.add_checkbox(
|
||||
tag=f"tool_toggle_{t_name}",
|
||||
label=f"Enable {t_name}",
|
||||
default_value=agent_tools.get(t_name, True)
|
||||
)
|
||||
|
||||
# ---- Files panel ----
|
||||
with dpg.window(
|
||||
|
||||
Reference in New Issue
Block a user