import {
  buildPromptDeliverableRepairPrompt,
  type PromptDeliverableFailure,
} from "../../prompt/runtime-prompts.js";

export type RuntimeObservationDeliverableFailure = PromptDeliverableFailure;
type DeliverableRuntimeObservation = {
  code: "PROMPT_DELIVERABLE_MISSING";
  message: string;
  severity: "error";
};

export function promptDeliverableMissingObservation(
  failures: PromptDeliverableFailure[],
): DeliverableRuntimeObservation {
  return {
    code: "PROMPT_DELIVERABLE_MISSING",
    severity: "error",
    message: buildPromptDeliverableRepairPrompt(failures),
  };
}

export function formatPromptDeliverableRepairObservation(
  failures: PromptDeliverableFailure[],
): string {
  return buildPromptDeliverableRepairPrompt(failures);
}
