import { type AgentPromptSuggestion, createAgentPromptSuggestion, } from "./agent-prompts.js"; import { TASK_PRIORITY_MODEL } from "./task-priorities.js"; type PromptPurpose = "prepare" | "implement" | "continue" | "review"; const PURPOSE_BY_STATUS: Readonly> = { triage: "prepare", backlog: "implement", todo: "implement", in_progress: "continue", review: "review", }; const ENGLISH_PROMPTS: Readonly string>> = { prepare: (id) => `Investigate ${id}, clarify the remaining requirements, and prepare it for backlog.`, implement: (id) => `Take on ${id} and complete the work until it is ready for review.`, continue: (id) => `Continue ${id} and complete the work until it is ready for review.`, review: (id) => `Review ${id}, address any issues, and complete the task.`, }; const SWEDISH_PROMPTS: Readonly string>> = { prepare: (id) => `Utred ${id}, klargör återstående krav och förbered kortet för backlog.`, implement: (id) => `Ta dig an ${id} och jobba klart tills kortet är redo för review.`, continue: (id) => `Fortsätt med ${id} och jobba klart tills kortet är redo för review.`, review: (id) => `Granska ${id}, åtgärda eventuella problem och slutför kortet.`, }; /** * Prompt suggestions intentionally recognize Pony's workflow status names * exactly. Custom statuses must not inherit an instruction whose semantics may * be wrong for that project's workflow. */ export function getTaskPromptSuggestion( taskId: string, status: string, projectLanguage: string, priority: string | null = null, priorityModel: string | null = null, ): AgentPromptSuggestion | null { if (priorityModel === TASK_PRIORITY_MODEL && priority === "not_planned") { return null; } const purpose = PURPOSE_BY_STATUS[status]; if (!purpose) return null; return createAgentPromptSuggestion( { en: ENGLISH_PROMPTS[purpose](taskId), sv: SWEDISH_PROMPTS[purpose](taskId), }, projectLanguage, ); }