mcp: export Event (#145)

Export the Event type in preparation for providing user-definable
storage for resumable streams.

Also, move event code to a separate file.

This PR is just renaming and code motion.
This commit is contained in:
Jonathan Amsterdam 2025-07-21 10:54:59 -04:00 • committed by GitHub
commit a519c182e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -520,7 +520,7 @@ func streamingRequest(ctx context.Context, serverURL, sessionID, method string,
}
// TODO(rfindley): do we need to check evt.name?
// Does the MCP spec say anything about this?
msg, err := jsonrpc2.DecodeMessage(evt.data)
msg, err := jsonrpc2.DecodeMessage(evt.Data)
if err != nil {
return newSessionID, resp.StatusCode, fmt.Errorf("decoding message: %w", err)
}