MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / extractText

Function extractText

server/src/utils/batch.ts:222–233  ·  view source on GitHub ↗
(result: BatchItemResult | undefined)

Source from the content-addressed store, hash-verified

220 * Returns null if the result is missing, failed, or has no text blocks.
221 */
222export function extractText(result: BatchItemResult | undefined): string | null {
223 if (!result || result.status !== 'succeeded' || !result.message) {
224 return null;
225 }
226
227 const text = result.message.content
228 .filter((block): block is Anthropic.TextBlock => block.type === 'text')
229 .map((block) => block.text)
230 .join('\n');
231
232 return text || null;
233}
234
235function sleep(ms: number): Promise<void> {
236 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 3

runGeoMonitorJobFunction · 0.50
runGeoContentPlannerJobFunction · 0.50
batch.test.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected