mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
refactor: dedupe health record helper
This commit is contained in:
@@ -20,6 +20,7 @@ import { normalizeAgentId } from "../routing/session-key.js";
|
||||
import { type RuntimeEnv, writeRuntimeJson } from "../runtime.js";
|
||||
import { styleHealthChannelLine } from "../terminal/health-style.js";
|
||||
import { isRich } from "../terminal/theme.js";
|
||||
import { isRecord } from "../utils.js";
|
||||
import { logGatewayConnectionDetails } from "./status.gateway-connection.js";
|
||||
|
||||
export type ChannelAccountHealthSummary = {
|
||||
@@ -164,7 +165,7 @@ const buildSessionSummary = (storePath: string) => {
|
||||
};
|
||||
|
||||
const asRecord = (value: unknown): Record<string, unknown> | null =>
|
||||
value && typeof value === "object" ? (value as Record<string, unknown>) : null;
|
||||
isRecord(value) ? value : null;
|
||||
|
||||
async function inspectHealthAccount(plugin: ChannelPlugin, cfg: OpenClawConfig, accountId: string) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user