generated from coulomb/repo-seed
- diagnostics.py: TunnelCheckResult with SSH process liveness, port probe, and optional API health check; check_tunnel / check_all_tunnels - cli.py: bridge status shows LIVE column and [STALE] marker when state says connected but PID is dead; bridge check wired to diagnostics - state.py: read_raw_pid helper; _pid_alive exported for reuse - capabilities.py: capabilities registry stubs - mcp_server/server.py: expose check_tunnel and tunnel capabilities over MCP - SCOPE.md: rapid orientation document - workplans/OPS-WP-0001-diagnostics.md: workplan backing this feature - tests: 207 passing (test_cli, test_mcp, test_diagnostics) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
79 lines
2.3 KiB
Python
79 lines
2.3 KiB
Python
"""Canonical capability registry for OpsBridge.
|
|
|
|
Every operation that can be invoked via CLI, MCP, or Skill must be listed here.
|
|
The cross-mode test suite uses this registry to enforce test coverage parity.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
ACCESS_MODES = frozenset({"cli", "mcp", "skill"})
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Capability:
|
|
name: str
|
|
description: str
|
|
required_access_modes: frozenset[str]
|
|
|
|
|
|
CAPABILITIES: list[Capability] = [
|
|
Capability(
|
|
name="bridge_up",
|
|
description="Start one or all tunnels",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="bridge_down",
|
|
description="Stop one or all tunnels",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="bridge_restart",
|
|
description="Restart one or all tunnels",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="bridge_status",
|
|
description="Show tunnel status",
|
|
required_access_modes=frozenset({"cli", "mcp", "skill"}),
|
|
),
|
|
Capability(
|
|
name="bridge_logs",
|
|
description="Tail tunnel audit log",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="catalog_list_targets",
|
|
description="List catalog targets",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="catalog_show_target",
|
|
description="Show target metadata",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="catalog_list_domains",
|
|
description="List catalog domains",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="catalog_validate",
|
|
description="Validate catalog consistency",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="catalog_show_bridge",
|
|
description="Show bridge metadata",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
Capability(
|
|
name="bridge_check",
|
|
description="End-to-end tunnel diagnostics via SSH: SSH PID alive + remote port listening",
|
|
required_access_modes=frozenset({"cli", "mcp"}),
|
|
),
|
|
]
|
|
|
|
CAPABILITIES_BY_NAME: dict[str, Capability] = {c.name: c for c in CAPABILITIES}
|