```ts
export function chainOfCommand(root: object, person: string): string[] {
  if (typeof root !== 'object' || root === null) throw new Error('Invalid root');
  if (typeof person !== 'string' || person.trim() === '') throw new Error('Invalid person');

  const stack = [{ node: root, path: [] }];
  while (stack.length > 0) {
    const { node, path } = stack.pop()!;
    if (node.name === person) return [...path, person];
    for (const report of node.reports || []) {
      stack.push({ node: report, path: [...path, node.name] });
    }
  }
  throw new Error('Person not found in the chart');
}

export function headcount(root: object): number {
  if (typeof root !== 'object' || root === null) throw new Error('Invalid root');

  let count = 1;
  const queue = [...(root.reports || [])];
  while (queue.length > 0) {
    const node = queue.shift()!;
    count++;
    queue.push(...(node.reports || []));
  }
  return count;
}

export function widestTeam(root: object): number {
  if (typeof root !== 'object' || root === null) throw new Error('Invalid root');

  let maxReports = 0;
  const queue = [{ node: root, level: 1 }];
  while (queue.length > 0) {
    const { node, level } = queue.shift()!;
    if (level > maxReports) maxReports = level;
    for (const report of node.reports || []) {
      queue.push({ node: report, level: level + 1 });
    }
  }
  return maxReports;
}
```