feat: split help into tabbed UI Guide / Tools / Persona pages

- cortex/static/TOOLS.md — tool reference extracted from HELP.md; uses ##
  headers so each category is collapsible. All 30 tools with descriptions.
- cortex/static/HELP.md — UI guide only; tools section replaced with a
  one-line pointer to the Tools tab.
- help.html — three tabs (UI Guide / Tools / Persona); tab choice persists
  in localStorage. Tools tab defaults all sections open. Persona tab shows
  home/{user}/persona/{name}/HELP.md with an empty-state message if unset.
- context_loader.py — loads cortex/static/TOOLS.md into context at tier 2+
  (replaces the previously empty persona HELP.md load). Persona HELP.md
  still loaded if non-empty, as persona-specific additions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-30 22:25:47 -04:00
parent 552fd56abb
commit 5ad2e50d69
4 changed files with 257 additions and 213 deletions

View File

@@ -1,5 +1,9 @@
from pathlib import Path
from persona import persona_path
_STATIC_DIR = Path(__file__).parent / "static"
# Core identity files — always loaded regardless of tier
_CORE = ["SOUL.md", "IDENTITY.md"]
@@ -52,8 +56,14 @@ def load_context(
if proto_path.exists():
parts.append(f"--- PROTOCOLS.md ---\n{proto_path.read_text()}")
# Global tool reference (same for all personas)
tools_path = _STATIC_DIR / "TOOLS.md"
if tools_path.exists():
parts.append(f"--- TOOLS.md ---\n{tools_path.read_text()}")
# Persona-specific help additions (optional)
help_path = inara_dir / "HELP.md"
if help_path.exists():
if help_path.exists() and help_path.stat().st_size > 10:
parts.append(f"--- HELP.md ---\n{help_path.read_text()}")
# ── 4. Pending reminders (tier 2+) ────────────────────────────