import type { RunPhaseName } from "@best-agent/protocol";
import type { ToolUsePolicy } from "../provider/model-provider.js";
import type { RequiredToolConstraint } from "./provider-turn/tool-constraint-types.js";

export function resolveProviderToolUsePolicy(
  input: Readonly<{
    allowPhaseResult?: boolean;
    allowPlanUpdate?: boolean;
    requiredToolConstraint?: RequiredToolConstraint;
  }>,
  context: Readonly<{
    artifactObligations?: readonly unknown[];
    phaseName?: RunPhaseName;
    profileName?: string;
  }>,
): ToolUsePolicy {
  void context;
  void input.requiredToolConstraint;
  if (input.allowPlanUpdate || input.allowPhaseResult) {
    return "required-tool-only";
  }
  return "answer-when-sufficient";
}
