MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / parseExtensionMessage

Function parseExtensionMessage

apps/cli/src/agent/message-processor.ts:456–466  ·  view source on GitHub ↗
(json: string)

Source from the content-addressed store, hash-verified

454 * Returns undefined if parsing fails.
455 */
456export function parseExtensionMessage(json: string): ExtensionMessage | undefined {
457 try {
458 const parsed = JSON.parse(json)
459 if (isValidExtensionMessage(parsed)) {
460 return parsed
461 }
462 return undefined
463 } catch {
464 return undefined
465 }
466}
467
468/**
469 * Parse the text field of an api_req_started message.

Callers 1

handleMessageMethod · 0.85

Calls 2

isValidExtensionMessageFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected