MCPcopy
hub / github.com/codeaashu/claude-code / textForResubmit

Function textForResubmit

src/utils/messages.ts:2873–2886  ·  view source on GitHub ↗
(
  msg: UserMessage,
)

Source from the content-addressed store, hash-verified

2871}
2872
2873export 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

Callers 1

REPLFunction · 0.85

Calls 3

getUserMessageTextFunction · 0.85
extractTagFunction · 0.85
stripIdeContextTagsFunction · 0.85

Tested by

no test coverage detected