MCPcopy Create free account
hub / github.com/Noumena-Network/code / textForResubmit

Function textForResubmit

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

Source from the content-addressed store, hash-verified

2940}
2941
2942export 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

Callers 1

Calls 3

getUserMessageTextFunction · 0.85
extractTagFunction · 0.85
stripIdeContextTagsFunction · 0.85

Tested by

no test coverage detected