source dump of claude code
at main 44 lines 2.9 kB view raw
1import { EXIT_PLAN_MODE_TOOL_NAME } from '../ExitPlanModeTool/constants.js' 2 3export const ASK_USER_QUESTION_TOOL_NAME = 'AskUserQuestion' 4 5export const ASK_USER_QUESTION_TOOL_CHIP_WIDTH = 12 6 7export const DESCRIPTION = 8 'Asks the user multiple choice questions to gather information, clarify ambiguity, understand preferences, make decisions or offer them choices.' 9 10export const PREVIEW_FEATURE_PROMPT = { 11 markdown: ` 12Preview feature: 13Use 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 19Preview 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: ` 22Preview feature: 23Use 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 28Preview 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 32export const ASK_USER_QUESTION_TOOL_PROMPT = `Use this tool when you need to ask the user questions during execution. This allows you to: 331. Gather user preferences or requirements 342. Clarify ambiguous instructions 353. Get decisions on implementation choices as you work 364. Offer choices to the user about what direction to take. 37 38Usage 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 43Plan 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`