( msg: UserMessage, )
| 2940 | } |
| 2941 | |
| 2942 | export function textForResubmit( |
| 2943 | msg: UserMessage, |
| 2944 | ): { text: string; mode: 'bash' | 'prompt' } | null { |
| 2945 | const content = getUserMessageText(msg) |
| 2946 | if (content === null) return null |
| 2947 | const bash = extractTag(content, 'bash-input') |
| 2948 | if (bash) return { text: bash, mode: 'bash' } |
| 2949 | const cmd = extractTag(content, COMMAND_NAME_TAG) |
| 2950 | if (cmd) { |
| 2951 | const args = extractTag(content, COMMAND_ARGS_TAG) ?? '' |
| 2952 | return { text: `${cmd} ${args}`, mode: 'prompt' } |
| 2953 | } |
| 2954 | return { text: stripIdeContextTags(content), mode: 'prompt' } |
| 2955 | } |
| 2956 | |
| 2957 | /** |
| 2958 | * Extract text from an array of content blocks, joining text blocks with the |
no test coverage detected