( msg: UserMessage, )
| 2871 | } |
| 2872 | |
| 2873 | export function textForResubmit( |
| 2874 | msg: UserMessage, |
| 2875 | ): { text: string; mode: 'bash' | 'prompt' } | null { |
| 2876 | const content = getUserMessageText(msg) |
| 2877 | if (content === null) return null |
| 2878 | const bash = extractTag(content, 'bash-input') |
| 2879 | if (bash) return { text: bash, mode: 'bash' } |
| 2880 | const cmd = extractTag(content, COMMAND_NAME_TAG) |
| 2881 | if (cmd) { |
| 2882 | const args = extractTag(content, COMMAND_ARGS_TAG) ?? '' |
| 2883 | return { text: `${cmd} ${args}`, mode: 'prompt' } |
| 2884 | } |
| 2885 | return { text: stripIdeContextTags(content), mode: 'prompt' } |
| 2886 | } |
| 2887 | |
| 2888 | /** |
| 2889 | * Extract text from an array of content blocks, joining text blocks with the |
no test coverage detected