"""HTML views for MCP runtime health (#430).""" from __future__ import annotations import html from webui.runtime_health import FileHash, RuntimeSnapshot def _hash_rows(items: tuple[FileHash, ...]) -> str: if not items: return "
No hashes available.
" rows = [] for item in items: digest = item.sha256 or item.error or "unavailable" rows.append( "{html.escape(item.path)}{html.escape(digest[:16] if item.sha256 else digest)}| Artifact | Path | SHA-256 | " "
|---|
Runtime snapshot incomplete: ' f"{html.escape(snapshot.fetch_error)}
Stale runtime warning: ' f"{html.escape(snapshot.stale_runtime_warning)}
| Profile | {html.escape(snapshot.profile_name)} |
|---|---|
| Role kind | {html.escape(snapshot.role_kind)} |
| Identity | {html.escape(identity)} |
| Config model | {html.escape(snapshot.config_model)} |
| Profile mode | {html.escape(snapshot.profile_mode)} " f"({html.escape(snapshot.profile_source)}) |
| Local HEAD | {html.escape(snapshot.repo_sha or 'unknown')} |
|---|---|
| Remote {html.escape(snapshot.remote)}/{html.escape('master')} | " f"{html.escape(snapshot.remote_master_sha or 'unknown')} |
| Commits behind | {snapshot.commits_behind_master if snapshot.commits_behind_master is not None else 'unknown'} |
{html.escape(str(shell.get('safe_next_action') or ''))}
" "MVP is read-only — restart MCP servers from your IDE/operator "
"workflow. Related issue: #420. Guidance: "
f"{html.escape(snapshot.restart_guidance)}
This page does not expose tokens or perform MCP restarts.
" )