mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 14:55:19 +00:00
16 lines
637 B
TypeScript
16 lines
637 B
TypeScript
type PromptPlaceholderInput = {
|
|
mode: "normal" | "shell"
|
|
commentCount: number
|
|
example: string
|
|
suggest: boolean
|
|
t: (key: string, params?: Record<string, string>) => string
|
|
}
|
|
|
|
export function promptPlaceholder(input: PromptPlaceholderInput) {
|
|
if (input.mode === "shell") return input.t("prompt.placeholder.shell")
|
|
if (input.commentCount > 1) return input.t("prompt.placeholder.summarizeComments")
|
|
if (input.commentCount === 1) return input.t("prompt.placeholder.summarizeComment")
|
|
if (!input.suggest) return input.t("prompt.placeholder.simple")
|
|
return input.t("prompt.placeholder.normal", { example: input.example })
|
|
}
|