```ts
export function resolveAccess(
  rules: Array<{ effect: string; action: string; path: string[] }>,
  request: { action: string; path: string[] }
): { decision: string; rule: number } {
  if (request.action === "") {
    throw new Error("Request action cannot be empty");
  }

  let bestDecision = "deny";
  let bestRuleIndex = -1;

  for (let i = 0; i < rules.length; i++) {
    const { effect, action, path } = rules[i];

    if (effect !== "allow" && effect !== "deny") {
      throw new Error(`Invalid rule effect: ${effect}`);
    }

    if (action === "") {
      throw new Error("Rule action cannot be empty");
    }

    if (
      request.path.slice(0, path.length).join("/") === path.join("/") &&
      (action === "any" || action === request.action)
    ) {
      if (
        path.length > bestPathLength ||
        (path.length === bestPathLength && action !== "any") ||
        (path.length === bestPathLength && action === "any" && effect === "deny")
      ) {
        bestDecision = effect;
        bestRuleIndex = i;
        bestPathLength = path.length;
      }
    }
  }

  return { decision: bestDecision, rule: bestRuleIndex };
}
```