Files
openclaw/src/config/exec-command-highlighting.ts
2026-05-12 03:59:30 +10:00

17 lines
650 B
TypeScript

import { normalizeAgentId } from "../routing/session-key.js";
import type { OpenClawConfig } from "./types.openclaw.js";
export function resolveExecCommandHighlighting(params: {
config?: OpenClawConfig | null;
agentId?: string | null;
}): boolean {
const config = params.config ?? {};
const globalValue = config.tools?.exec?.commandHighlighting;
const agentId = params.agentId ? normalizeAgentId(params.agentId) : null;
const agentValue = agentId
? config.agents?.list?.find((entry) => normalizeAgentId(entry.id) === agentId)?.tools?.exec
?.commandHighlighting
: undefined;
return agentValue ?? globalValue ?? false;
}