Watchdog API Client (api/watchdog.js)

alphaclaw · lib/public/js/lib/api/watchdog.js · javascript · MIT
infra, integration, lang:javascript, tag:watchdog

JavaScript module for interacting with watchdog monitoring endpoints, including status, incidents, and repair actions. Use for building monitoring dashboards.

// Source: https://github.com/garrytan/alphaclaw | License: MIT | Copyright 2025 chrysb
// Provided via justclaw.it.com; keep this notice with the code.
import { authFetch } from "./http.js";
import { parseJsonOrThrow } from "./parse.js";

export async function fetchWatchdogStatus() {
  const res = await authFetch("/api/watchdog/status");
  return parseJsonOrThrow(res, "Could not load watchdog status");
}

export async function fetchWatchdogIncidents({ limit = 10, before = null } = {}) {
  const params = new URLSearchParams({ limit: String(limit) });
  if (before != null) params.set("before", String(before));
  const res = await authFetch(`/api/watchdog/incidents?${params.toString()}`);
  return parseJsonOrThrow(res, "Could not load watchdog incidents");
}

export async function fetchWatch

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key