diff --git a/packages/cli/src/features/prompts/prompt-adapter.ts b/packages/cli/src/features/prompts/prompt-adapter.ts index dcb010a1..565143dc 100644 --- a/packages/cli/src/features/prompts/prompt-adapter.ts +++ b/packages/cli/src/features/prompts/prompt-adapter.ts @@ -6,6 +6,7 @@ import { select, text, } from "@clack/prompts"; +import { renderCliMutedText } from "../../utils/terminal-format"; import type { ConfirmPromptOptions, PasswordPromptOptions, @@ -67,8 +68,7 @@ function withPromptDescription< if (!description) return options; return { ...options, - message: `${options.message}\n${description}`, - description: undefined, + description: renderCliMutedText(description), }; } diff --git a/packages/cli/tests/prompt-adapter.test.ts b/packages/cli/tests/prompt-adapter.test.ts index d3079751..800b3da1 100644 --- a/packages/cli/tests/prompt-adapter.test.ts +++ b/packages/cli/tests/prompt-adapter.test.ts @@ -7,18 +7,25 @@ import type { PromptBackend, SelectPromptOptions, } from "../src/features/prompts"; +import { renderCliMutedText } from "../src/utils/terminal-format"; describe("prompt adapter", () => { - it("renders prompt descriptions after the question", async () => { - const messages: string[] = []; + it("passes prompt descriptions separately with the muted CLI style", async () => { + const prompts: Array<{ message: string; description?: string }> = []; const adapter = createPromptAdapter( backend({ text: async (options) => { - messages.push(options.message); + prompts.push({ + message: options.message, + description: options.description, + }); return "answered"; }, confirm: async (options) => { - messages.push(options.message); + prompts.push({ + message: options.message, + description: options.description, + }); return true; }, }), @@ -33,9 +40,17 @@ describe("prompt adapter", () => { description: "Keeps agent changes out of the main checkout.", }); - expect(messages).toEqual([ - "Workspace name\nNames this local devos workspace.", - "Use isolated worktrees?\nKeeps agent changes out of the main checkout.", + expect(prompts).toEqual([ + { + message: "Workspace name", + description: renderCliMutedText("Names this local devos workspace."), + }, + { + message: "Use isolated worktrees?", + description: renderCliMutedText( + "Keeps agent changes out of the main checkout.", + ), + }, ]); });