more adjustments

This commit is contained in:
2026-03-12 19:08:51 -04:00
parent 19e7c94c2e
commit 1f8bb58219
14 changed files with 272 additions and 213 deletions

View File

@@ -852,7 +852,6 @@ class AppController:
self.ui_separate_tier4 = False
self.config = models.load_config()
path_info = paths.get_full_path_info()
self.ui_conductor_dir = str(path_info['conductor_dir']['path'])
self.ui_logs_dir = str(path_info['logs_dir']['path'])
self.ui_scripts_dir = str(path_info['scripts_dir']['path'])
theme.load_from_config(self.config)
@@ -890,6 +889,7 @@ class AppController:
self.ui_shots_base_dir = self.project.get("screenshots", {}).get("base_dir", ".")
proj_meta = self.project.get("project", {})
self.ui_project_git_dir = proj_meta.get("git_dir", "")
self.ui_project_conductor_dir = self.project.get('conductor', {}).get('dir', 'conductor')
self.ui_project_main_context = proj_meta.get("main_context", "")
self.ui_project_system_prompt = proj_meta.get("system_prompt", "")
self.ui_gemini_cli_path = self.project.get("gemini_cli", {}).get("binary_path", "gemini")
@@ -962,7 +962,7 @@ class AppController:
agent_tools_cfg = self.project.get("agent", {}).get("tools", {})
self.ui_agent_tools = {t: agent_tools_cfg.get(t, True) for t in models.AGENT_TOOL_NAMES}
label = self.project.get("project", {}).get("name", "")
session_logger.open_session(label=label)
session_logger.reset_session(label=label)
# Trigger auto-start of MCP servers
self.event_queue.put('refresh_external_mcps', None)
@@ -2295,6 +2295,7 @@ class AppController:
proj["screenshots"]["paths"] = self.screenshots
proj.setdefault("project", {})
proj["project"]["git_dir"] = self.ui_project_git_dir
proj.setdefault("conductor", {})["dir"] = self.ui_project_conductor_dir
proj["project"]["system_prompt"] = self.ui_project_system_prompt
proj["project"]["main_context"] = self.ui_project_main_context
proj["project"]["active_preset"] = self.ui_project_preset_name

View File

@@ -1419,6 +1419,15 @@ class App:
r.destroy()
if d: self.ui_output_dir = d
imgui.separator()
imgui.text("Conductor Directory")
ch, self.ui_project_conductor_dir = imgui.input_text("##cond_dir", self.ui_project_conductor_dir)
imgui.same_line()
if imgui.button("Browse##cond"):
r = hide_tk_root()
d = filedialog.askdirectory(title="Select Conductor Directory")
r.destroy()
if d: self.ui_project_conductor_dir = d
imgui.separator()
imgui.text("Project Files")
imgui.begin_child("proj_files", imgui.ImVec2(0, 150), True)
for i, pp in enumerate(self.project_paths):
@@ -1473,7 +1482,6 @@ class App:
def _save_paths(self):
self.config["paths"] = {
"conductor_dir": self.ui_conductor_dir,
"logs_dir": self.ui_logs_dir,
"scripts_dir": self.ui_scripts_dir
}
@@ -1482,7 +1490,8 @@ class App:
shutil.copy(cfg_path, str(cfg_path) + ".bak")
models.save_config(self.config)
paths.reset_resolved()
self.ai_status = "paths saved - restart required"
self.init_state()
self.ai_status = 'paths applied and session reset'
def _render_paths_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_paths_panel")
@@ -1490,10 +1499,6 @@ class App:
imgui.text_colored(C_IN, "System Path Configuration")
imgui.separator()
if self.ai_status == "paths saved - restart required":
imgui.text_colored(vec4(255, 50, 50), "Restart required for path changes to take effect.")
imgui.separator()
def render_path_field(label: str, attr: str, key: str, tooltip: str):
info = path_info.get(key, {'source': 'unknown'})
@@ -1513,7 +1518,6 @@ class App:
r.destroy()
if d: setattr(self, attr, d)
render_path_field("Conductor Directory", "ui_conductor_dir", "conductor_dir", "Base directory for implementation tracks and project state.")
render_path_field("Logs Directory", "ui_logs_dir", "logs_dir", "Directory where session JSON-L logs and artifacts are stored.")
render_path_field("Scripts Directory", "ui_scripts_dir", "scripts_dir", "Directory for AI-generated PowerShell scripts.")

View File

@@ -6,13 +6,11 @@ This module provides centralized path resolution for all configurable paths in t
Environment Variables:
SLOP_CONFIG: Path to config.toml
SLOP_CONDUCTOR_DIR: Path to conductor directory
SLOP_LOGS_DIR: Path to logs directory
SLOP_SCRIPTS_DIR: Path to generated scripts directory
Configuration (config.toml):
[paths]
conductor_dir = "conductor"
logs_dir = "logs/sessions"
scripts_dir = "scripts/generated"
@@ -27,8 +25,8 @@ Path Functions:
Resolution Order:
1. Check project-specific manual_slop.toml (for conductor paths)
2. Check environment variable
3. Check config.toml [paths] section
2. Check environment variable (for logs/scripts)
3. Check config.toml [paths] section (for logs/scripts)
4. Fall back to default
Usage:
@@ -110,37 +108,15 @@ def _get_project_conductor_dir_from_toml(project_root: Path) -> Optional[Path]:
return None
def get_conductor_dir(project_path: Optional[str] = None) -> Path:
if project_path:
project_root = Path(project_path).resolve()
p = _get_project_conductor_dir_from_toml(project_root)
if p: return p
if not project_path:
# Fallback for legacy/tests, but we should avoid this
return Path('conductor').resolve()
if "conductor_dir" not in _RESOLVED:
# Check env and config
root_dir = Path(__file__).resolve().parent.parent
env_val = os.environ.get("SLOP_CONDUCTOR_DIR")
if env_val:
p = Path(env_val)
if not p.is_absolute(): p = root_dir / p
_RESOLVED["conductor_dir"] = p.resolve()
else:
try:
with open(get_config_path(), "rb") as f:
cfg = tomllib.load(f)
if "paths" in cfg and "conductor_dir" in cfg["paths"]:
p = Path(cfg["paths"]["conductor_dir"])
if not p.is_absolute(): p = root_dir / p
_RESOLVED["conductor_dir"] = p.resolve()
except: pass
if "conductor_dir" in _RESOLVED:
return _RESOLVED["conductor_dir"]
project_root = Path(project_path).resolve()
p = _get_project_conductor_dir_from_toml(project_root)
if p: return p
if project_path:
return (Path(project_path).resolve() / "conductor").resolve()
root_dir = Path(__file__).resolve().parent.parent
return (root_dir / "conductor").resolve()
return (project_root / "conductor").resolve()
def get_logs_dir() -> Path:
if "logs_dir" not in _RESOLVED:
@@ -179,7 +155,6 @@ def _resolve_path_info(env_var: str, config_key: str, default: str) -> dict[str,
def get_full_path_info() -> dict[str, dict[str, Any]]:
return {
'conductor_dir': _resolve_path_info('SLOP_CONDUCTOR_DIR', 'conductor_dir', 'conductor'),
'logs_dir': _resolve_path_info('SLOP_LOGS_DIR', 'logs_dir', 'logs/sessions'),
'scripts_dir': _resolve_path_info('SLOP_SCRIPTS_DIR', 'scripts_dir', 'scripts/generated')
}

View File

@@ -112,6 +112,11 @@ def close_session() -> None:
except Exception as e:
print(f"Warning: Could not update auto-whitelist on close: {e}")
def reset_session(label: Optional[str] = None) -> None:
"""Closes the current session and opens a new one with the given label."""
close_session()
open_session(label)
def log_api_hook(method: str, path: str, payload: str) -> None:
"""Log an API hook invocation."""
if _api_fh is None: