prompt.ts
 1  import { EXIT_PLAN_MODE_TOOL_NAME } from '../ExitPlanModeTool/constants.js'
 2  
 3  export const ASK_USER_QUESTION_TOOL_NAME = 'AskUserQuestion'
 4  
 5  export const ASK_USER_QUESTION_TOOL_CHIP_WIDTH = 12
 6  
 7  export const DESCRIPTION =
 8    'Asks the user multiple choice questions to gather information, clarify ambiguity, understand preferences, make decisions or offer them choices.'
 9  
10  export const PREVIEW_FEATURE_PROMPT = {
11    markdown: `
12  Preview feature:
13  Use the optional \`preview\` field on options when presenting concrete artifacts that users need to visually compare:
14  - ASCII mockups of UI layouts or components
15  - Code snippets showing different implementations
16  - Diagram variations
17  - Configuration examples
18  
19  Preview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).
20  `,
21    html: `
22  Preview feature:
23  Use the optional \`preview\` field on options when presenting concrete artifacts that users need to visually compare:
24  - HTML mockups of UI layouts or components
25  - Formatted code snippets showing different implementations
26  - Visual comparisons or diagrams
27  
28  Preview content must be a self-contained HTML fragment (no <html>/<body> wrapper, no <script> or <style> tags — use inline style attributes instead). Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).
29  `,
30  } as const
31  
32  export const ASK_USER_QUESTION_TOOL_PROMPT = `Use this tool when you need to ask the user questions during execution. This allows you to:
33  1. Gather user preferences or requirements
34  2. Clarify ambiguous instructions
35  3. Get decisions on implementation choices as you work
36  4. Offer choices to the user about what direction to take.
37  
38  Usage notes:
39  - Users will always be able to select "Other" to provide custom text input
40  - Use multiSelect: true to allow multiple answers to be selected for a question
41  - If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label
42  
43  Plan mode note: In plan mode, use this tool to clarify requirements or choose between approaches BEFORE finalizing your plan. Do NOT use this tool to ask "Is my plan ready?" or "Should I proceed?" - use ${EXIT_PLAN_MODE_TOOL_NAME} for plan approval. IMPORTANT: Do not reference "the plan" in your questions (e.g., "Do you have feedback about the plan?", "Does the plan look good?") because the user cannot see the plan in the UI until you call ${EXIT_PLAN_MODE_TOOL_NAME}. If you need plan approval, use ${EXIT_PLAN_MODE_TOOL_NAME} instead.
44  `