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

Function convertResultMessage

src/remote/sdkMessageAdapter.ts:56–70  ·  view source on GitHub ↗

* Convert an SDKResultMessage to a SystemMessage

(msg: SDKResultMessage)

Source from the content-addressed store, hash-verified

54 * Convert an SDKResultMessage to a SystemMessage
55 */
56function convertResultMessage(msg: SDKResultMessage): SystemMessage {
57 const isError = msg.subtype !== 'success'
58 const content = isError
59 ? msg.errors?.join(', ') || 'Unknown error'
60 : 'Session completed successfully'
61
62 return {
63 type: 'system',
64 subtype: 'informational',
65 content,
66 level: isError ? 'warning' : 'info',
67 uuid: msg.uuid!,
68 timestamp: new Date().toISOString(),
69 }
70}
71
72/**
73 * Convert an SDKSystemMessage (init) to a SystemMessage

Callers 1

convertSDKMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected