MCPcopy
hub / github.com/claude-code-best/claude-code / extractSystemText

Function extractSystemText

src/utils/sideQuery.ts:118–125  ·  view source on GitHub ↗

* Extract system prompt text from the `system` option.

(system?: string | TextBlockParam[])

Source from the content-addressed store, hash-verified

116 * Extract system prompt text from the `system` option.
117 */
118function extractSystemText(system?: string | TextBlockParam[]): string {
119 if (!system) return ''
120 if (typeof system === 'string') return system
121 return system
122 .filter((b): b is { type: 'text'; text: string } => 'text' in b && !!b.text)
123 .map(b => b.text)
124 .join('\n\n')
125}
126
127/**
128 * Convert Anthropic MessageParam[] to a list of {role, content} objects

Callers 2

sideQueryViaGeminiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected