MCPcopy Index your code
hub / github.com/codeaashu/claude-code / convertResultMessage

Function convertResultMessage

src/remote/sdkMessageAdapter.ts:55–69  ·  view source on GitHub ↗

* Convert an SDKResultMessage to a SystemMessage

(msg: SDKResultMessage)

Source from the content-addressed store, hash-verified

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

Callers 1

convertSDKMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected