checkpoint: I have to fix try/finally spam by this ai

This commit is contained in:
2026-03-11 21:43:19 -04:00
parent 56f79fd210
commit 4dee0e6f69
5 changed files with 313 additions and 244 deletions

View File

@@ -2,6 +2,7 @@
provider = "minimax" provider = "minimax"
model = "MiniMax-M2.5" model = "MiniMax-M2.5"
temperature = 0.0 temperature = 0.0
top_p = 1.0
max_tokens = 32000 max_tokens = 32000
history_trunc_limit = 900000 history_trunc_limit = 900000
active_preset = "Default" active_preset = "Default"
@@ -53,13 +54,13 @@ Response = false
"Tool Calls" = true "Tool Calls" = true
Theme = true Theme = true
"Log Management" = true "Log Management" = true
Diagnostics = true Diagnostics = false
[theme] [theme]
palette = "Nord Dark" palette = "Nord Dark"
font_path = "C:/projects/manual_slop/assets/fonts/Inter-Regular.ttf" font_path = "C:/projects/manual_slop/assets/fonts/Inter-Regular.ttf"
font_size = 14.0 font_size = 14.0
scale = 1.2999999523162842 scale = 1.0
transparency = 1.0 transparency = 1.0
child_transparency = 1.0 child_transparency = 1.0

View File

@@ -74,8 +74,8 @@ Collapsed=0
DockId=0xAFC85805,2 DockId=0xAFC85805,2
[Window][Theme] [Window][Theme]
Pos=0,1370 Pos=0,1786
Size=788,767 Size=788,351
Collapsed=0 Collapsed=0
DockId=0x00000002,2 DockId=0x00000002,2
@@ -85,14 +85,14 @@ Size=900,700
Collapsed=0 Collapsed=0
[Window][Diagnostics] [Window][Diagnostics]
Pos=2641,22 Pos=2641,34
Size=1199,2115 Size=1199,2103
Collapsed=0 Collapsed=0
DockId=0x00000010,2 DockId=0x00000010,2
[Window][Context Hub] [Window][Context Hub]
Pos=0,1370 Pos=0,1786
Size=788,767 Size=788,351
Collapsed=0 Collapsed=0
DockId=0x00000002,1 DockId=0x00000002,1
@@ -103,26 +103,26 @@ Collapsed=0
DockId=0x0000000D,0 DockId=0x0000000D,0
[Window][Discussion Hub] [Window][Discussion Hub]
Pos=1668,26 Pos=1668,25
Size=971,2111 Size=915,2112
Collapsed=0 Collapsed=0
DockId=0x00000013,0 DockId=0x00000013,0
[Window][Operations Hub] [Window][Operations Hub]
Pos=790,26 Pos=790,25
Size=876,1455 Size=876,2112
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000005,0
[Window][Files & Media] [Window][Files & Media]
Pos=0,1370 Pos=0,1786
Size=788,767 Size=788,351
Collapsed=0 Collapsed=0
DockId=0x00000002,0 DockId=0x00000002,0
[Window][AI Settings] [Window][AI Settings]
Pos=0,26 Pos=0,25
Size=788,1342 Size=788,1759
Collapsed=0 Collapsed=0
DockId=0x00000001,0 DockId=0x00000001,0
@@ -132,14 +132,14 @@ Size=416,325
Collapsed=0 Collapsed=0
[Window][MMA Dashboard] [Window][MMA Dashboard]
Pos=2641,26 Pos=2585,25
Size=1199,1689 Size=1255,2112
Collapsed=0 Collapsed=0
DockId=0x00000010,0 DockId=0x00000010,0
[Window][Log Management] [Window][Log Management]
Pos=2641,26 Pos=2585,25
Size=1199,1689 Size=1255,2112
Collapsed=0 Collapsed=0
DockId=0x00000010,1 DockId=0x00000010,1
@@ -167,8 +167,8 @@ Collapsed=0
DockId=0x00000004,0 DockId=0x00000004,0
[Window][Tier 3: Workers] [Window][Tier 3: Workers]
Pos=2641,1717 Pos=2641,1719
Size=916,420 Size=916,418
Collapsed=0 Collapsed=0
DockId=0x0000000C,0 DockId=0x0000000C,0
@@ -323,8 +323,8 @@ Size=420,966
Collapsed=0 Collapsed=0
[Window][Preset Manager] [Window][Preset Manager]
Pos=2239,1184 Pos=937,444
Size=904,777 Size=1759,1245
Collapsed=0 Collapsed=0
[Window][Task DAG] [Window][Task DAG]
@@ -333,19 +333,24 @@ Size=967,499
Collapsed=0 Collapsed=0
[Window][Usage Analytics] [Window][Usage Analytics]
Pos=3559,1717 Pos=2641,1719
Size=281,420 Size=1199,418
Collapsed=0 Collapsed=0
DockId=0x0000000F,0 DockId=0x0000000F,0
[Window][Tool Preset Manager] [Window][Tool Preset Manager]
Pos=970,1111 Pos=1298,303
Size=1103,921 Size=2219,1661
Collapsed=0 Collapsed=1
[Window][Persona Editor] [Window][Persona Editor]
Pos=889,365 Pos=909,391
Size=1183,713 Size=1886,1234
Collapsed=0
[Window][Prompt Presets Manager]
Pos=856,546
Size=1000,800
Collapsed=0 Collapsed=0
[Table][0xFB6E3870,4] [Table][0xFB6E3870,4]
@@ -379,11 +384,11 @@ Column 3 Width=20
Column 4 Weight=1.0000 Column 4 Weight=1.0000
[Table][0x2A6000B6,4] [Table][0x2A6000B6,4]
RefScale=14 RefScale=24
Column 0 Width=42 Column 0 Width=72
Column 1 Width=62 Column 1 Width=106
Column 2 Weight=1.0000 Column 2 Weight=1.0000
Column 3 Width=105 Column 3 Width=180
[Table][0x8BCC69C7,6] [Table][0x8BCC69C7,6]
RefScale=13 RefScale=13
@@ -402,11 +407,11 @@ Column 2 Weight=1.0000
Column 3 Width=105 Column 3 Width=105
[Table][0x2C515046,4] [Table][0x2C515046,4]
RefScale=18 RefScale=24
Column 0 Width=55 Column 0 Width=73
Column 1 Weight=1.0000 Column 1 Weight=1.0000
Column 2 Width=136 Column 2 Width=181
Column 3 Width=54 Column 3 Width=72
[Table][0xD99F45C5,4] [Table][0xD99F45C5,4]
Column 0 Sort=0v Column 0 Sort=0v
@@ -427,29 +432,54 @@ Column 1 Width=100
Column 2 Weight=1.0000 Column 2 Weight=1.0000
[Table][0xA02D8C87,3] [Table][0xA02D8C87,3]
RefScale=14 RefScale=24
Column 0 Width=158 Column 0 Width=270
Column 1 Width=105 Column 1 Width=180
Column 2 Weight=1.0000 Column 2 Weight=1.0000
[Table][0xD0277E63,2]
RefScale=17
Column 0 Width=141
Column 1 Weight=1.0000
[Table][0x3AAF84D5,2]
RefScale=24
Column 0 Width=150
Column 1 Weight=1.0000
[Table][0x8D8494AB,2]
RefScale=24
Column 0 Width=200
Column 1 Weight=1.0000
[Table][0x2C261E6E,2]
RefScale=24
Column 0 Width=150
Column 1 Weight=1.0000
[Table][0x9CB1E6FD,2]
RefScale=17
Column 0 Width=200
Column 1 Weight=1.0000
[Docking][Data] [Docking][Data]
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,26 Size=3840,2111 Split=X DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,25 Size=3840,2112 Split=X
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2639,1183 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2583,1183 Split=X
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=788,858 Split=Y Selected=0x8CA2375C DockNode ID=0x00000007 Parent=0x0000000B SizeRef=788,858 Split=Y Selected=0x8CA2375C
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,1342 CentralNode=1 Selected=0x7BD57D6A DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,1759 CentralNode=1 Selected=0x7BD57D6A
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,767 Selected=0x1DCB2623 DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,351 Selected=0x1DCB2623
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1849,858 Split=X Selected=0x418C7449 DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1793,858 Split=X Selected=0x418C7449
DockNode ID=0x00000012 Parent=0x0000000E SizeRef=876,402 Split=Y Selected=0x418C7449 DockNode ID=0x00000012 Parent=0x0000000E SizeRef=876,402 Split=Y Selected=0x418C7449
DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1455 Selected=0x418C7449 DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1455 Selected=0x418C7449
DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,654 Selected=0x1D56B311 DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,654 Selected=0x1D56B311
DockNode ID=0x00000013 Parent=0x0000000E SizeRef=971,402 Selected=0x6F2B5B04 DockNode ID=0x00000013 Parent=0x0000000E SizeRef=915,402 Selected=0x6F2B5B04
DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6 DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6
DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=1199,1183 Split=Y Selected=0x3AEC3498 DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=1255,1183 Split=Y Selected=0x3AEC3498
DockNode ID=0x00000010 Parent=0x00000004 SizeRef=1199,1689 Selected=0x3AEC3498 DockNode ID=0x00000010 Parent=0x00000004 SizeRef=1199,1689 Selected=0x2C0206CE
DockNode ID=0x00000011 Parent=0x00000004 SizeRef=1199,420 Split=X Selected=0xDEB547B6 DockNode ID=0x00000011 Parent=0x00000004 SizeRef=1199,420 Split=X Selected=0xDEB547B6
DockNode ID=0x0000000C Parent=0x00000011 SizeRef=916,380 Selected=0x655BC6E9 DockNode ID=0x0000000C Parent=0x00000011 SizeRef=916,380 Selected=0x655BC6E9
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=281,380 Selected=0xDEB547B6 DockNode ID=0x0000000F Parent=0x00000011 SizeRef=281,380 Selected=0xDEB547B6

View File

@@ -17,3 +17,4 @@ model = "gemini-3-flash-preview"
temperature = -1.4901161193847656e-08 temperature = -1.4901161193847656e-08
max_output_tokens = 32000 max_output_tokens = 32000
history_trunc_limit = 900000 history_trunc_limit = 900000
top_p = 1.0

View File

@@ -942,8 +942,8 @@ class App:
avail = imgui.get_content_region_avail() avail = imgui.get_content_region_avail()
if not hasattr(self, "_prompt_md_preview"): self._prompt_md_preview = False if not hasattr(self, "_prompt_md_preview"): self._prompt_md_preview = False
try:
if imgui.begin_table("prompt_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v): if imgui.begin_table("prompt_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
try:
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200) imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
imgui.table_next_row() imgui.table_next_row()
@@ -951,6 +951,7 @@ class App:
# Left Column: Presets # Left Column: Presets
imgui.table_next_column() imgui.table_next_column()
imgui.begin_child("prompt_list_pane", imgui.ImVec2(0, 0), False) imgui.begin_child("prompt_list_pane", imgui.ImVec2(0, 0), False)
try:
if imgui.button("New Preset", imgui.ImVec2(-1, 0)): if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
self._editing_preset_name = "" self._editing_preset_name = ""
self._editing_preset_system_prompt = "" self._editing_preset_system_prompt = ""
@@ -959,12 +960,13 @@ class App:
imgui.separator() imgui.separator()
preset_names = sorted(self.controller.presets.keys()) preset_names = sorted(self.controller.presets.keys())
for i, name in enumerate(preset_names): for i, name in enumerate(preset_names):
if imgui.selectable(name, self._selected_preset_idx == i)[0]: if name and imgui.selectable(f"{name}##p_{i}", self._selected_preset_idx == i)[0]:
self._selected_preset_idx = i self._selected_preset_idx = i
self._editing_preset_name = name self._editing_preset_name = name
p = self.controller.presets[name] p = self.controller.presets[name]
self._editing_preset_system_prompt = p.system_prompt self._editing_preset_system_prompt = p.system_prompt
self._editing_preset_scope = self.controller.preset_manager.get_preset_scope(name) self._editing_preset_scope = self.controller.preset_manager.get_preset_scope(name)
finally:
imgui.end_child() imgui.end_child()
# Right Column: Editor # Right Column: Editor
@@ -972,29 +974,26 @@ class App:
avail_r = imgui.get_content_region_avail() avail_r = imgui.get_content_region_avail()
# Subtract space for bottom buttons # Subtract space for bottom buttons
imgui.begin_child("prompt_edit_pane", imgui.ImVec2(0, avail_r.y - 45), False) imgui.begin_child("prompt_edit_pane", imgui.ImVec2(0, avail_r.y - 45), False)
try:
p_disp = self._editing_preset_name or "(New Preset)" p_disp = self._editing_preset_name or "(New Preset)"
imgui.text_colored(C_IN, f"Editing Prompt Preset: {p_disp}") imgui.text_colored(C_IN, f"Editing Prompt Preset: {p_disp}")
imgui.separator() imgui.separator()
if imgui.begin_table("p_meta", 2): if imgui.begin_table("p_meta", 2):
try:
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80) imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80)
imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
imgui.table_next_row() imgui.table_next_row()
imgui.table_next_column() imgui.table_next_column(); imgui.text("Name:")
imgui.text("Name:") imgui.table_next_column(); imgui.set_next_item_width(-1)
imgui.table_next_column()
imgui.set_next_item_width(-1)
_, self._editing_preset_name = imgui.input_text("##epn", self._editing_preset_name) _, self._editing_preset_name = imgui.input_text("##epn", self._editing_preset_name)
imgui.table_next_row() imgui.table_next_row()
imgui.table_next_column(); imgui.text("Scope:")
imgui.table_next_column() imgui.table_next_column()
imgui.text("Scope:") if imgui.radio_button("Global", self._editing_preset_scope == "global"): self._editing_preset_scope = "global"
imgui.table_next_column()
if imgui.radio_button("Global", self._editing_preset_scope == "global"):
self._editing_preset_scope = "global"
imgui.same_line() imgui.same_line()
if imgui.radio_button("Project", self._editing_preset_scope == "project"): if imgui.radio_button("Project", self._editing_preset_scope == "project"): self._editing_preset_scope = "project"
self._editing_preset_scope = "project" finally:
imgui.end_table() imgui.end_table()
imgui.dummy(imgui.ImVec2(0, 4)) imgui.dummy(imgui.ImVec2(0, 4))
@@ -1006,10 +1005,13 @@ class App:
if self._prompt_md_preview: if self._prompt_md_preview:
imgui.begin_child("prompt_preview", imgui.ImVec2(-1, imgui.get_content_region_avail().y), True) imgui.begin_child("prompt_preview", imgui.ImVec2(-1, imgui.get_content_region_avail().y), True)
self.markdown_renderer.render(self._editing_preset_system_prompt) try:
markdown_helper.render(self._editing_preset_system_prompt, context_id="prompt_preset_preview")
finally:
imgui.end_child() imgui.end_child()
else: else:
_, self._editing_preset_system_prompt = imgui.input_text_multiline("##pcont", self._editing_preset_system_prompt, imgui.ImVec2(-1, imgui.get_content_region_avail().y)) _, self._editing_preset_system_prompt = imgui.input_text_multiline("##pcont", self._editing_preset_system_prompt, imgui.ImVec2(-1, imgui.get_content_region_avail().y))
finally:
imgui.end_child() imgui.end_child()
# Bottom Buttons # Bottom Buttons
@@ -1030,9 +1032,8 @@ class App:
imgui.same_line() imgui.same_line()
if imgui.button("Close", imgui.ImVec2(100, 0)): if imgui.button("Close", imgui.ImVec2(100, 0)):
self.show_preset_manager_window = False self.show_preset_manager_window = False
imgui.end_table()
finally: finally:
pass imgui.end_table()
def _render_preset_manager_window(self, is_embedded: bool = False) -> None: def _render_preset_manager_window(self, is_embedded: bool = False) -> None:
if not self.show_preset_manager_window and not is_embedded: return if not self.show_preset_manager_window and not is_embedded: return
@@ -1063,8 +1064,8 @@ class App:
if not hasattr(self, "_bias_weights_open"): self._bias_weights_open = True if not hasattr(self, "_bias_weights_open"): self._bias_weights_open = True
if not hasattr(self, "_bias_cats_open"): self._bias_cats_open = True if not hasattr(self, "_bias_cats_open"): self._bias_cats_open = True
try:
if imgui.begin_table("tp_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v): if imgui.begin_table("tp_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
try:
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200) imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
imgui.table_next_row() imgui.table_next_row()
@@ -1072,16 +1073,18 @@ class App:
# Left Sidebar # Left Sidebar
imgui.table_next_column() imgui.table_next_column()
imgui.begin_child("tp_list_pane", imgui.ImVec2(0, 0), False) imgui.begin_child("tp_list_pane", imgui.ImVec2(0, 0), False)
try:
if imgui.button("New Preset", imgui.ImVec2(-1, 0)): if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
self._editing_tool_preset_name = ""; self._editing_tool_preset_categories = {cat: {} for cat in models.DEFAULT_TOOL_CATEGORIES} self._editing_tool_preset_name = ""; self._editing_tool_preset_categories = {cat: {} for cat in models.DEFAULT_TOOL_CATEGORIES}
self._editing_tool_preset_scope = "project"; self._selected_tool_preset_idx = -1 self._editing_tool_preset_scope = "project"; self._selected_tool_preset_idx = -1
imgui.separator() imgui.separator()
preset_names = sorted(self.controller.tool_presets.keys()) preset_names = sorted(self.controller.tool_presets.keys())
for i, name in enumerate(preset_names): for i, name in enumerate(preset_names):
if imgui.selectable(name, self._selected_tool_preset_idx == i)[0]: if imgui.selectable(f"{name}##tp_{i}", self._selected_tool_preset_idx == i)[0]:
self._selected_tool_preset_idx = i; self._editing_tool_preset_name = name self._selected_tool_preset_idx = i; self._editing_tool_preset_name = name
preset = self.controller.tool_presets[name] preset = self.controller.tool_presets[name]
self._editing_tool_preset_categories = {cat: copy.deepcopy(tools) for cat, tools in preset.categories.items()} self._editing_tool_preset_categories = {cat: copy.deepcopy(tools) for cat, tools in preset.categories.items()}
finally:
imgui.end_child() imgui.end_child()
# Right Editor # Right Editor
@@ -1089,17 +1092,19 @@ class App:
avail_r = imgui.get_content_region_avail() avail_r = imgui.get_content_region_avail()
# Bottom buttons reserved space # Bottom buttons reserved space
imgui.begin_child("tp_editor_content", imgui.ImVec2(0, avail_r.y - 45), False) imgui.begin_child("tp_editor_content", imgui.ImVec2(0, avail_r.y - 45), False)
try:
p_name = self._editing_tool_preset_name or "(New Tool Preset)" p_name = self._editing_tool_preset_name or "(New Tool Preset)"
imgui.text_colored(C_IN, f"Editing Tool Preset: {p_name}"); imgui.separator() imgui.text_colored(C_IN, f"Editing Tool Preset: {p_name}"); imgui.separator()
if imgui.begin_table("tp_meta", 2): if imgui.begin_table("tp_meta", 2):
try:
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80); imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80); imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Name:"); imgui.table_next_column(); imgui.set_next_item_width(-1); _, self._editing_tool_preset_name = imgui.input_text("##etpn", self._editing_tool_preset_name) imgui.table_next_row(); imgui.table_next_column(); imgui.text("Name:"); imgui.table_next_column(); imgui.set_next_item_width(-1); _, self._editing_tool_preset_name = imgui.input_text("##etpn", self._editing_tool_preset_name)
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Scope:"); imgui.table_next_column() imgui.table_next_row(); imgui.table_next_column(); imgui.text("Scope:"); imgui.table_next_column()
if imgui.radio_button("Global", self._editing_tool_preset_scope == "global"): self._editing_tool_preset_scope = "global" if imgui.radio_button("Global", self._editing_tool_preset_scope == "global"): self._editing_tool_preset_scope = "global"
imgui.same_line(); imgui.same_line();
if imgui.radio_button("Project", self._editing_tool_preset_scope == "project"): self._editing_tool_preset_scope = "project" if imgui.radio_button("Project", self._editing_tool_preset_scope == "project"): self._editing_tool_preset_scope = "project"
finally:
imgui.end_table() imgui.end_table()
# Vertical split calculation # Vertical split calculation
@@ -1122,19 +1127,21 @@ class App:
if ch_cat: self.ui_tool_filter_category = cat_opts[next_f_idx] if ch_cat: self.ui_tool_filter_category = cat_opts[next_f_idx]
imgui.begin_child("tp_scroll", imgui.ImVec2(0, h1), True) imgui.begin_child("tp_scroll", imgui.ImVec2(0, h1), True)
try:
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items(): for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
if self.ui_tool_filter_category != "All" and self.ui_tool_filter_category != cat_name: continue if self.ui_tool_filter_category != "All" and self.ui_tool_filter_category != cat_name: continue
if imgui.tree_node(cat_name): if imgui.tree_node(cat_name):
if cat_name not in self._editing_tool_preset_categories: self._editing_tool_preset_categories[cat_name] = [] if cat_name not in self._editing_tool_preset_categories: self._editing_tool_preset_categories[cat_name] = []
curr_cat_tools = self._editing_tool_preset_categories[cat_name] curr_cat_tools = self._editing_tool_preset_categories[cat_name]
if imgui.begin_table(f"tt_{cat_name}", 2, imgui.TableFlags_.borders_inner_v): if imgui.begin_table(f"tt_{cat_name}", 2, imgui.TableFlags_.borders_inner_v):
try:
imgui.table_setup_column("Tool", imgui.TableColumnFlags_.width_fixed, 250); imgui.table_setup_column("Ctrls", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("Tool", imgui.TableColumnFlags_.width_fixed, 250); imgui.table_setup_column("Ctrls", imgui.TableColumnFlags_.width_stretch)
for tool_name in default_tools: for tool_name in default_tools:
tool = next((t for t in curr_cat_tools if t.name == tool_name), None) tool = next((t for t in curr_cat_tools if t.name == tool_name), None)
mode = "disabled" if tool is None else tool.approval mode = "disabled" if tool is None else tool.approval
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tool_name); imgui.table_next_column() imgui.table_next_row(); imgui.table_next_column(); imgui.text(tool_name); imgui.table_next_column()
if imgui.radio_button(f"Off##{cat_name}_{tool_name}", mode == "disabled"): if imgui.radio_button(f"Off##{cat_name}_{tool_name}", mode == "disabled"):
if tool: current_cat_tools.remove(tool) if tool: curr_cat_tools.remove(tool)
imgui.same_line(); imgui.same_line();
if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"): if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"):
if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool) if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool)
@@ -1143,7 +1150,10 @@ class App:
if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"): if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"):
if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool) if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool)
else: tool.approval = "ask" else: tool.approval = "ask"
imgui.end_table(); imgui.tree_pop() finally:
imgui.end_table()
imgui.tree_pop()
finally:
imgui.end_child() imgui.end_child()
if self._bias_list_open: if self._bias_list_open:
imgui.button("###tool_splitter", imgui.ImVec2(-1, 4)) imgui.button("###tool_splitter", imgui.ImVec2(-1, 4))
@@ -1155,21 +1165,26 @@ class App:
if self._bias_list_open: if self._bias_list_open:
imgui.begin_child("bias_area", imgui.ImVec2(0, h2), True) imgui.begin_child("bias_area", imgui.ImVec2(0, h2), True)
try:
if imgui.begin_table("bias_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v): if imgui.begin_table("bias_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
try:
imgui.table_setup_column("BList", imgui.TableColumnFlags_.width_fixed, 150); imgui.table_setup_column("BEdit", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("BList", imgui.TableColumnFlags_.width_fixed, 150); imgui.table_setup_column("BEdit", imgui.TableColumnFlags_.width_stretch)
imgui.table_next_row(); imgui.table_next_column() imgui.table_next_row(); imgui.table_next_column()
imgui.begin_child("blist_pane", imgui.ImVec2(0, 0), False) imgui.begin_child("blist_pane", imgui.ImVec2(0, 0), False)
try:
if imgui.button("New Profile", imgui.ImVec2(-1, 0)): if imgui.button("New Profile", imgui.ImVec2(-1, 0)):
self._editing_bias_profile_name = ""; self._editing_bias_profile_tool_weights = {} self._editing_bias_profile_name = ""; self._editing_bias_profile_tool_weights = {}
self._editing_bias_profile_category_multipliers = {}; self._selected_bias_profile_idx = -1 self._editing_bias_profile_category_multipliers = {}; self._selected_bias_profile_idx = -1
imgui.separator(); bnames = sorted(self.bias_profiles.keys()) imgui.separator(); bnames = sorted(self.bias_profiles.keys())
for i, bname in enumerate(bnames): for i, bname in enumerate(bnames):
if imgui.selectable(bname, self._selected_bias_profile_idx == i)[0]: if imgui.selectable(f"{bname}##b_{i}", self._selected_bias_profile_idx == i)[0]:
self._selected_bias_profile_idx = i; self._editing_bias_profile_name = bname; prof = self.bias_profiles[bname] self._selected_bias_profile_idx = i; self._editing_bias_profile_name = bname; prof = self.bias_profiles[bname]
self._editing_bias_profile_tool_weights = copy.deepcopy(prof.tool_weights); self._editing_bias_profile_category_multipliers = copy.deepcopy(prof.category_multipliers) self._editing_bias_profile_tool_weights = copy.deepcopy(prof.tool_weights); self._editing_bias_profile_category_multipliers = copy.deepcopy(prof.category_multipliers)
finally:
imgui.end_child() imgui.end_child()
imgui.table_next_column() imgui.table_next_column()
imgui.begin_child("bedit_pane", imgui.ImVec2(0, 0), False) imgui.begin_child("bedit_pane", imgui.ImVec2(0, 0), False)
try:
imgui.text("Name:"); imgui.same_line(); imgui.set_next_item_width(-1); _, self._editing_bias_profile_name = imgui.input_text("##bname", self._editing_bias_profile_name) imgui.text("Name:"); imgui.same_line(); imgui.set_next_item_width(-1); _, self._editing_bias_profile_name = imgui.input_text("##bname", self._editing_bias_profile_name)
rem_bias_y = imgui.get_content_region_avail().y - 45 # Save button space rem_bias_y = imgui.get_content_region_avail().y - 45 # Save button space
@@ -1183,16 +1198,21 @@ class App:
if opened_bw != self._bias_weights_open: self._bias_weights_open = opened_bw if opened_bw != self._bias_weights_open: self._bias_weights_open = opened_bw
if self._bias_weights_open: if self._bias_weights_open:
imgui.begin_child("btool_scroll", imgui.ImVec2(0, bh1), True) imgui.begin_child("btool_scroll", imgui.ImVec2(0, bh1), True)
try:
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items(): for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
if imgui.tree_node(f"{cat_name}##b"): if imgui.tree_node(f"{cat_name}##b"):
if imgui.begin_table(f"bt_{cat_name}", 2): if imgui.begin_table(f"bt_{cat_name}", 2):
try:
imgui.table_setup_column("T", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("W", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("T", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("W", imgui.TableColumnFlags_.width_stretch)
for tn in default_tools: for tn in default_tools:
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tn); imgui.table_next_column() imgui.table_next_row(); imgui.table_next_column(); imgui.text(tn); imgui.table_next_column()
curr_w = self._editing_bias_profile_tool_weights.get(tn, 3); imgui.set_next_item_width(-1) curr_w = self._editing_bias_profile_tool_weights.get(tn, 3); imgui.set_next_item_width(-1)
ch_w, n_w = imgui.slider_int(f"##bw_{tn}", curr_w, 1, 10); ch_w, n_w = imgui.slider_int(f"##bw_{tn}", curr_w, 1, 10);
if ch_w: self._editing_bias_profile_tool_weights[tn] = n_w if ch_w: self._editing_bias_profile_tool_weights[tn] = n_w
imgui.end_table(); imgui.tree_pop() finally:
imgui.end_table()
imgui.tree_pop()
finally:
imgui.end_child() imgui.end_child()
if self._bias_cats_open: if self._bias_cats_open:
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4)) imgui.button("###bias_splitter", imgui.ImVec2(-1, 4))
@@ -1202,23 +1222,32 @@ class App:
if opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc if opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc
if self._bias_cats_open: if self._bias_cats_open:
imgui.begin_child("bcat_scroll", imgui.ImVec2(0, bh2), True) imgui.begin_child("bcat_scroll", imgui.ImVec2(0, bh2), True)
try:
if imgui.begin_table("bcats", 2): if imgui.begin_table("bcats", 2):
try:
imgui.table_setup_column("C", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("M", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("C", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("M", imgui.TableColumnFlags_.width_stretch)
for cn in sorted(models.DEFAULT_TOOL_CATEGORIES.keys()): for cn in sorted(models.DEFAULT_TOOL_CATEGORIES.keys()):
imgui.table_next_row(); imgui.table_next_column(); imgui.text(cn); imgui.table_next_column() imgui.table_next_row(); imgui.table_next_column(); imgui.text(cn); imgui.table_next_column()
curr_m = self._editing_bias_profile_category_multipliers.get(cn, 1.0); imgui.set_next_item_width(-1) curr_m = self._editing_bias_profile_category_multipliers.get(cn, 1.0); imgui.set_next_item_width(-1)
ch_m, n_m = imgui.slider_float(f"##cm_{cn}", curr_m, 0.1, 5.0, "%.1fx"); ch_m, n_m = imgui.slider_float(f"##cm_{cn}", curr_m, 0.1, 5.0, "%.1fx");
if ch_m: self._editing_bias_profile_category_multipliers[cn] = n_m if ch_m: self._editing_bias_profile_category_multipliers[cn] = n_m
imgui.end_table(); imgui.end_child() finally:
imgui.end_table()
finally:
imgui.end_child()
if imgui.button("Save Profile", imgui.ImVec2(-1, 0)): if imgui.button("Save Profile", imgui.ImVec2(-1, 0)):
try: try:
p = models.BiasProfile(name=self._editing_bias_profile_name, tool_weights=self._editing_bias_profile_tool_weights, category_multipliers=self._editing_bias_profile_category_multipliers) p = models.BiasProfile(name=self._editing_bias_profile_name, tool_weights=self._editing_bias_profile_tool_weights, category_multipliers=self._editing_bias_profile_category_multipliers)
self.controller._cb_save_bias_profile(p, self._editing_tool_preset_scope); self.ai_status = f"Saved: {p.name}" self.controller._cb_save_bias_profile(p, self._editing_tool_preset_scope); self.ai_status = f"Saved: {p.name}"
except Exception as e: self.ai_status = f"Error: {e}" except Exception as e: self.ai_status = f"Error: {e}"
finally:
imgui.end_child() imgui.end_child()
finally:
imgui.end_table() imgui.end_table()
finally:
imgui.end_child() imgui.end_child()
finally:
imgui.end_child() imgui.end_child()
# --- Footer Buttons --- # --- Footer Buttons ---
@@ -1231,6 +1260,7 @@ class App:
imgui.same_line(); imgui.same_line();
if not is_embedded: if not is_embedded:
if imgui.button("Close", imgui.ImVec2(100, 0)): self.show_tool_preset_manager_window = False if imgui.button("Close", imgui.ImVec2(100, 0)): self.show_tool_preset_manager_window = False
finally:
imgui.end_table() imgui.end_table()
finally: finally:
pass pass

View File

@@ -45,3 +45,10 @@ search_files = 4
[bias_profiles.Discovery-Heavy.category_multipliers] [bias_profiles.Discovery-Heavy.category_multipliers]
Web = 1.5 Web = 1.5
Analysis = 1.3 Analysis = 1.3
[bias_profiles.""]
name = ""
[bias_profiles."".tool_weights]
[bias_profiles."".category_multipliers]