// src/backends/pi/args.ts
function normalizePiModel(model) {
  if (model.includes("/")) return model;
  if (model.startsWith("gemini-")) return `google/${model}`;
  if (model.startsWith("claude-")) return `anthropic/${model}`;
  if (model.startsWith("gpt-") || model.startsWith("o1-") || model.startsWith("o3-") || model.startsWith("o4-") || model.startsWith("chatgpt-")) return `openai/${model}`;
  return model;
}
function buildPiArgs(input) {
  const args = [
    "-p",
    "--mode",
    "json",
    "--no-extensions"
  ];
  if (input.backendSessionId) {
    args.push("--session", input.backendSessionId);
  }
  if (input.agent.model) {
    const modelId = typeof input.agent.model === "string" ? input.agent.model : input.agent.model.id;
    if (modelId) args.push("--model", normalizePiModel(modelId));
  }
  args.push(input.prompt);
  return args;
}

export {
  buildPiArgs
};
