Project Monitor agent: LLM-powered project status reports with wiki+Gitea integration
This commit is contained in:
@@ -81,6 +81,35 @@ def collect_sections(config):
|
||||
print(f" Reading List failed: {e}", file=sys.stderr)
|
||||
sections.append(("Reading List", "## Reading List\n\n*Unavailable.*\n", f"error: {e}"))
|
||||
|
||||
# --- Project Monitors (LLM-powered) ---
|
||||
instance_id = config.get("instance_id", 0)
|
||||
user_id = config.get("user_id", 0)
|
||||
if user_id:
|
||||
try:
|
||||
# Fetch this user's project-monitor instances that are set to include in briefing
|
||||
pm_instances = api_request(
|
||||
f"{DASHBOARD_API}/api/instances/by-user/{user_id}?catalog_id=project-monitor",
|
||||
retries=1,
|
||||
)
|
||||
project_sections = []
|
||||
for pm in pm_instances:
|
||||
pm_config = pm.get("config", {})
|
||||
if str(pm_config.get("include_in_briefing", "false")).lower() != "true":
|
||||
continue
|
||||
try:
|
||||
from project_monitor import run as pm_run
|
||||
md, summary = pm_run(pm_config, user_id=user_id, instance_id=pm.get("id"))
|
||||
project_sections.append(md)
|
||||
print(f" Project [{pm_config.get('project_name', '?')}]: {summary[:80]}")
|
||||
except Exception as e:
|
||||
print(f" Project [{pm_config.get('project_name', '?')}] failed: {e}", file=sys.stderr)
|
||||
|
||||
if project_sections:
|
||||
combined = "## Projects\n\n" + "\n\n".join(project_sections)
|
||||
sections.append(("Projects", combined, f"{len(project_sections)} project(s)"))
|
||||
except Exception as e:
|
||||
print(f" Project monitors skipped: {e}", file=sys.stderr)
|
||||
|
||||
return sections
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user