```ts
/**
 * Walks the chart from its head and returns the list of names leading from the head down to the given person.
 * @param root - The root node of the organization chart.
 * @param person - The name of the person to find in the chain of command.
 * @returns An array of names representing the chain of command from the head to the given person.
 */
export function chainOfCommand(root: { reports?: object[]; name?: string }, person: string): string[] {
  if (typeof root !== 'object' || !root) throw new Error('Invalid root node');
  if (typeof person !== 'string' || person.trim() === '') throw new Error('Invalid person name');

  const traverse = (node: { reports?: object[]; name?: string }, currentPath: string[]): string[][] => {
    if (typeof node.name !== 'string' || node.name.trim() === '') throw new Error('Node name must be a non-empty string');
    if (currentPath.includes(node.name)) throw new Error('Duplicate person found in the chart');

    if (node.name === person) return [currentPath.concat(node.name)];

    if (!Array.isArray(node.reports)) throw new Error('Invalid reports list');

    let paths: string[][] = [];
    for (const report of node.reports) {
      const result = traverse(report, currentPath.concat(node.name));
      paths = paths.concat(result);
    }

    return paths;
  };

  const results = traverse(root, []);
  if (results.length === 0) throw new Error('Person not found in the chart');

  return results[0];
}

/**
 * Returns the total number of people in the organization chart.
 * @param root - The root node of the organization chart.
 * @returns The total number of people in the chart, including the head.
 */
export function headcount(root: { reports?: object[] }): number {
  if (typeof root !== 'object' || !root) throw new Error('Invalid root node');

  const count = (node: { reports?: object[] }): number => {
    if (!Array.isArray(node.reports)) throw new Error('Invalid reports list');
    return 1 + node.reports.reduce((acc, report) => acc + count(report), 0);
  };

  return count(root);
}

/**
 * Returns the largest count of direct reports any single person has.
 * @param root - The root node of the organization chart.
 * @returns The largest count of direct reports for any single person.
 */
export function widestTeam(root: { reports?: object[] }): number {
  if (typeof root !== 'object' || !root) throw new Error('Invalid root node');

  const maxReports = (node: { reports?: object[] }): number => {
    if (!Array.isArray(node.reports)) throw new Error('Invalid reports list');
    return Math.max(0, ...node.reports.map(maxReports));
  };

  return maxReports(root);
}
```