mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 19:04:45 +00:00
17 lines
650 B
TypeScript
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;
|
|
}
|