swift-sdk/Sources/MCP
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ayal Spitz f6e401aa97
Fix event stream line parsing to handle CRLF and empty lines correctly (#89)
* Optimized code in `connectToEventStream` to use `.lines` computed value of `AsyncSequence` to produce a `AsyncLineSequence` instead of building a lines manually.

* - Reverter use of `lines` (it swallows newlines)
- Fiexed original issue I experienced with line 229 `while let newlineIndex = buffer.firstIndex(of: "\n") {` not handling "\r\n" properly
- Added unit test to test for "\r\n" scenario
- Simplified `end of event` test - `line` creation trims newline, added code trims carriage return. Only thing that should be left is an empty line
2025-04-27 06:50:08 -07:00
..
Base Fix event stream line parsing to handle CRLF and empty lines correctly (#89) 2025-04-27 06:50:08 -07:00
Client Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00
Extensions Initial implementation 2025-02-11 15:22:35 -08:00
Server Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00