diff --git a/app/mcp_client.py b/app/mcp_client.py index 9ce2c2c..6ac7b02 100644 --- a/app/mcp_client.py +++ b/app/mcp_client.py @@ -173,3 +173,11 @@ async def list_skills(domain: Optional[str] = None) -> Dict[str, Any]: async def get_skill(name: str) -> Dict[str, Any]: return await _call_tool("get_skill", {"name": name}) + + +async def ingest_git_history(content: str) -> Dict[str, Any]: + return await _call_tool("ingest_git_history", {"content": content}) + + +async def ingest_activity_log(content: str) -> Dict[str, Any]: + return await _call_tool("ingest_activity_log", {"content": content}) diff --git a/app/routers/worklog.py b/app/routers/worklog.py index ef1372b..ac53799 100644 --- a/app/routers/worklog.py +++ b/app/routers/worklog.py @@ -4,7 +4,7 @@ from __future__ import annotations from typing import Optional -from fastapi import APIRouter, HTTPException +from fastapi import APIRouter, HTTPException, Request from app import mcp_client @@ -37,3 +37,31 @@ async def api_standup(days: int = 2, context: str = "egmont"): return await mcp_client.get_standup(days=days, context=context) except Exception as exc: raise HTTPException(status_code=502, detail=f"DevOpsMCP error: {exc}") from exc + + +@router.post("/worklog/sync") +async def api_worklog_sync(request: Request): + """Accept raw ~/.githistory content and ingest into DevOpsMCP Redis.""" + body = await request.body() + content = body.decode("utf-8", errors="replace") + if not content.strip(): + raise HTTPException(status_code=400, detail="Empty body — send content of ~/.githistory") + try: + result = await mcp_client.ingest_git_history(content) + return {"message": "Git history synced", "result": result} + except Exception as exc: + raise HTTPException(status_code=502, detail=f"DevOpsMCP error: {exc}") from exc + + +@router.post("/worklog/sync-activity") +async def api_worklog_sync_activity(request: Request): + """Accept raw ~/.activitylog content and ingest into DevOpsMCP Redis.""" + body = await request.body() + content = body.decode("utf-8", errors="replace") + if not content.strip(): + raise HTTPException(status_code=400, detail="Empty body — send content of ~/.activitylog") + try: + result = await mcp_client.ingest_activity_log(content) + return {"message": "Activity log synced", "result": result} + except Exception as exc: + raise HTTPException(status_code=502, detail=f"DevOpsMCP error: {exc}") from exc diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index bc63cfc..6448872 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -8,277 +8,519 @@ + - -
+ +
- ⚡ DevOpsDash - i80.dk + + DevOpsDash + +