Files
cursor-mcp/src/cursor_mcp/audit.py
nearxos 1d71b3f822 Add v1.1.0 with progress streaming, timeouts, and git validation.
Surface Cursor run progress to stderr and response payloads, enforce
CURSOR_TIMEOUT_SECONDS, validate git repos before delegate, and fix
resume session cwd persistence. Includes docs, tests, and packaging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 08:08:14 +03:00

23 lines
608 B
Python

"""Audit log for Cursor delegations."""
from __future__ import annotations
import json
from datetime import datetime, timezone
from pathlib import Path
from typing import Any
from cursor_mcp.config import settings
def audit_log(event: str, payload: dict[str, Any]) -> None:
path = Path(settings.audit_log_path).expanduser()
path.parent.mkdir(parents=True, exist_ok=True)
record = {
"ts": datetime.now(timezone.utc).isoformat(),
"event": event,
**payload,
}
with path.open("a", encoding="utf-8") as fh:
fh.write(json.dumps(record, default=str) + "\n")