feat(tui-gateway): surface config.quick_commands in commands.catalog

This commit is contained in:
Brooklyn Nicholson 2026-04-18 09:16:37 -05:00
parent 4e1ea79edc
commit 5152e1ad86

View file

@ -1987,8 +1987,35 @@ def _(rid, params: dict) -> dict:
cat_order.append(cat)
cat_map[cat].append([name, desc])
skill_count = 0
warning = ""
try:
qcmds = _load_cfg().get("quick_commands", {}) or {}
if isinstance(qcmds, dict) and qcmds:
bucket = "User commands"
if bucket not in cat_map:
cat_map[bucket] = []
cat_order.append(bucket)
for qname, qc in sorted(qcmds.items()):
if not isinstance(qc, dict):
continue
key = f"/{qname}"
canon[key.lower()] = key
qtype = qc.get("type", "")
if qtype == "exec":
default_desc = f"exec: {qc.get('command', '')}"
elif qtype == "alias":
default_desc = f"alias → {qc.get('target', '')}"
else:
default_desc = qtype or "quick command"
qdesc = str(qc.get("description") or default_desc)
qdesc = qdesc[:120] + ("" if len(qdesc) > 120 else "")
all_pairs.append([key, qdesc])
cat_map[bucket].append([key, qdesc])
except Exception as e:
if not warning:
warning = f"quick_commands discovery unavailable: {e}"
skill_count = 0
try:
from agent.skill_commands import scan_skill_commands
for k, info in sorted(scan_skill_commands().items()):