feat(infra): commit live infra-audit/cluster work to reconcile git with prod
This work (network_hosts inventory + infra_audit MCP tool, /api/cluster + Sacred Valley cluster card, topbar cluster-health pill + SW self-heal) was built in an earlier session and DEPLOYED to CT 311 as alpha.24–26, but was never committed to git — prod was running code absent from the repo. Commits it as-is (already prod-validated) so git matches the live state, and restores its alpha.24/25/26 CHANGELOG entries. Files are disjoint from the fold-in work; both now ship together under alpha.27. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { createRegistry } from '../../registry.js';
|
||||
import { searchTool } from '../search.js';
|
||||
import { listActionsTool, proposeActionTool } from './actions.js';
|
||||
import { infraAuditTool } from './infra_audit.js';
|
||||
|
||||
// read (search) + her action tools. No propose_change (she fixes infra, not content).
|
||||
// read (search) + her action tools + infra sanity check. No propose_change
|
||||
// (she fixes infra, not content).
|
||||
export const blueRegistry = createRegistry();
|
||||
blueRegistry.registerTool(searchTool);
|
||||
blueRegistry.registerTool(listActionsTool);
|
||||
blueRegistry.registerTool(proposeActionTool);
|
||||
blueRegistry.registerTool(infraAuditTool);
|
||||
|
||||
17
lib/ai/agent/tools/blue/infra_audit.js
Normal file
17
lib/ai/agent/tools/blue/infra_audit.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// Little Blue's infra sanity check. Runs in the MCP child (no infra creds) — it
|
||||
// calls the main server's read-only /api/infra/audit, which probes wiki-referenced
|
||||
// endpoints + registered service URLs and reports anything unreachable (e.g. a
|
||||
// doc/registry pointing at a stale IP) plus inventory hosts missing a MAC.
|
||||
function api(env = process.env) { return { base: env.VOID_API_URL, token: env.VOID_AGENT_TOKEN }; }
|
||||
|
||||
export const infraAuditTool = {
|
||||
name: 'infra_audit',
|
||||
description: 'Run a homelab sanity check: probe every IP:port the wiki references and every monitored service, and report unreachable endpoints (stale/incorrect IPs or ports) plus inventory hosts missing a MAC. Read-only — use to verify the docs/registry match reality.',
|
||||
input_schema: { type: 'object', properties: {} },
|
||||
async handler(_args, _ctx, { fetchImpl = fetch } = {}) {
|
||||
const { base, token } = api();
|
||||
const res = await fetchImpl(`${base}/api/infra/audit`, { headers: { Authorization: `Bearer ${token}` } });
|
||||
if (!res.ok) return { error: `infra_audit ${res.status}` };
|
||||
return res.json();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user