- MonitorBridgeClient gains pushOpenClawMeta() method for POST /openclaw - OpenClawMeta interface defines version/plugin_version/agents payload - Plugin pushes metadata on gateway_start (delayed 2s) and periodically - Interval aligns with reportIntervalSec (default 30s) - Pushes are non-fatal — plugin continues if Monitor is unreachable - Interval cleanup on gateway_stop - Updated monitor-server-connector-plan.md with new architecture
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
/**
|
|
* Monitor Bridge Client
|
|
*
|
|
* Queries the local HarborForge.Monitor bridge endpoint on MONITOR_PORT
|
|
* to enrich plugin telemetry with host/hardware data.
|
|
*
|
|
* If the bridge is unreachable, all methods return null gracefully —
|
|
* the plugin continues to function without Monitor data.
|
|
*/
|
|
export interface MonitorHealth {
|
|
status: string;
|
|
monitor_version: string;
|
|
identifier: string;
|
|
}
|
|
export interface MonitorTelemetryResponse {
|
|
status: string;
|
|
monitor_version: string;
|
|
identifier: string;
|
|
telemetry?: {
|
|
identifier: string;
|
|
plugin_version: string;
|
|
cpu_pct: number;
|
|
mem_pct: number;
|
|
disk_pct: number;
|
|
swap_pct: number;
|
|
load_avg: number[];
|
|
uptime_seconds: number;
|
|
nginx_installed: boolean;
|
|
nginx_sites: string[];
|
|
};
|
|
last_updated?: string;
|
|
}
|
|
export declare class MonitorBridgeClient {
|
|
private baseUrl;
|
|
private timeoutMs;
|
|
constructor(port: number, timeoutMs?: number);
|
|
health(): Promise<MonitorHealth | null>;
|
|
telemetry(): Promise<MonitorTelemetryResponse | null>;
|
|
/**
|
|
* POST OpenClaw metadata to the Monitor bridge so it can enrich
|
|
* its heartbeat uploads with OpenClaw version, plugin version,
|
|
* and agent information.
|
|
*/
|
|
pushOpenClawMeta(meta: OpenClawMeta): Promise<boolean>;
|
|
private fetchJson;
|
|
}
|
|
/**
|
|
* OpenClaw metadata payload sent to the Monitor bridge.
|
|
*/
|
|
export interface OpenClawMeta {
|
|
version: string;
|
|
plugin_version: string;
|
|
agents?: any[];
|
|
}
|
|
//# sourceMappingURL=monitor-bridge.d.ts.map
|