INNER CODE UNIT · TypeScript

validateToolNames

hexclave/hexclave · apps/backend/src/lib/ai/tools/index.ts:94

export function validateToolNames(toolNames: unknown): toolNames is ToolName[] {
  if (!Array.isArray(toolNames)) {
    return false;
  }
  return toolNames.every((name): name is ToolName =>
    typeof name === "string" && (TOOL_NAMES as readonly string[]).includes(name)
  );
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…