diff --git a/CLAUDE.md b/CLAUDE.md index 52f35f2..2006038 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,4 +43,4 @@ Swift SDK for the A2A (Agent-to-Agent) protocol v1.0. - Run specific suite: `swift test --filter EventQueueManagerTests` ## Current Version -- Latest release: `0.3.0` (A2AVapor integration target, AgentCardResolver with caching) +- Latest release: `0.4.0` (SSE reconnection, connection health monitoring, streaming session API) diff --git a/Samples/A2AChatClient/Package.swift b/Samples/A2AChatClient/Package.swift index 891b964..383e917 100644 --- a/Samples/A2AChatClient/Package.swift +++ b/Samples/A2AChatClient/Package.swift @@ -8,7 +8,7 @@ let package = Package( .macOS(.v15), ], dependencies: [ - .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.2.0"), + .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.4.0"), ], targets: [ .executableTarget( diff --git a/Samples/A2AChatClient/README.md b/Samples/A2AChatClient/README.md index 82e7ed8..e1ffcaa 100644 --- a/Samples/A2AChatClient/README.md +++ b/Samples/A2AChatClient/README.md @@ -179,4 +179,4 @@ https://my-agent.example.com The only requirement is that the agent serves: - `GET /.well-known/agent-card.json` — agent card -- `POST /` — JSON-RPC endpoint (message/send or message/sendStream) +- `POST /` — JSON-RPC endpoint (SendMessage or SendStreamingMessage) diff --git a/Samples/A2AServer/Package.swift b/Samples/A2AServer/Package.swift index c6a349d..eadb1ca 100644 --- a/Samples/A2AServer/Package.swift +++ b/Samples/A2AServer/Package.swift @@ -9,7 +9,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/vapor/vapor.git", from: "4.100.0"), - .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.3.0"), + .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.4.0"), .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.20.0"), ], targets: [ diff --git a/Samples/A2AServer/README.md b/Samples/A2AServer/README.md index c3c25e6..6fe9ae7 100644 --- a/Samples/A2AServer/README.md +++ b/Samples/A2AServer/README.md @@ -73,10 +73,11 @@ curl -X POST http://localhost:8080 \ -d '{ "jsonrpc": "2.0", "id": 1, - "method": "message/send", + "method": "SendMessage", "params": { "message": { - "role": "user", + "messageId": "msg-1", + "role": "ROLE_USER", "parts": [{"text": "What laptops do you have?"}] } } @@ -92,10 +93,11 @@ curl -X POST http://localhost:8080 \ -d '{ "jsonrpc": "2.0", "id": 1, - "method": "message/sendStream", + "method": "SendStreamingMessage", "params": { "message": { - "role": "user", + "messageId": "msg-1", + "role": "ROLE_USER", "parts": [{"text": "Compare your most expensive and cheapest products"}] } } @@ -112,10 +114,11 @@ curl -X POST http://localhost:8080 \ -d '{ "jsonrpc": "2.0", "id": 2, - "method": "message/sendStream", + "method": "SendStreamingMessage", "params": { "message": { - "role": "user", + "messageId": "msg-2", + "role": "ROLE_USER", "parts": [{"text": "Which one has better reviews?"}], "taskId": "TASK_ID_FROM_PREVIOUS_RESPONSE" } @@ -226,9 +229,7 @@ Replace `products.json` with your own catalog. The expected format: "price": 999.99, "category": "Category", "inStock": true, - "specs": { - "key": "value" - } + "tags": ["keyword1", "keyword2"] } ] ``` diff --git a/Samples/A2AServer/Sources/ProductCatalog.swift b/Samples/A2AServer/Sources/ProductCatalog.swift index 739fe0b..1522d4f 100644 --- a/Samples/A2AServer/Sources/ProductCatalog.swift +++ b/Samples/A2AServer/Sources/ProductCatalog.swift @@ -27,7 +27,7 @@ struct ProductCatalog: Sendable { let terms = query.lowercased().split(separator: " ") return products.filter { product in let searchable = "\(product.name) \(product.category) \(product.description) \(product.tags.joined(separator: " "))".lowercased() - return terms.allSatisfy { searchable.contains($0) } + return terms.contains { searchable.contains($0) } } } diff --git a/Samples/README.md b/Samples/README.md index c5f66c1..fc2a3fb 100644 --- a/Samples/README.md +++ b/Samples/README.md @@ -85,7 +85,7 @@ swift run │ A2AChatClient │ ◄──── (JSON-RPC + SSE) ────► │ A2AServer │ │ │ │ │ │ SwiftUI + FM │ 1. Agent card discovery │ Vapor + Ollama │ -│ orchestration │ 2. message/send (streaming) │ product catalog │ +│ orchestration │ 2. SendMessage (streaming) │ product catalog │ │ │ 3. Task continuations │ conversation memory │ └──────────────────────┘ └──────────────────────┘ ``` diff --git a/Sources/A2A/A2A.docc/GettingStarted.md b/Sources/A2A/A2A.docc/GettingStarted.md index a228fbe..32b6bab 100644 --- a/Sources/A2A/A2A.docc/GettingStarted.md +++ b/Sources/A2A/A2A.docc/GettingStarted.md @@ -12,7 +12,7 @@ Add A2A to your `Package.swift`: ```swift dependencies: [ - .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.3.0") + .package(url: "https://github.com/Victory-Apps/a2a-swift.git", from: "0.4.0") ] ```