@@ -31,10 +31,10 @@ class ClientState implements ClientStateInterface
3131 private ?Implementation $ serverInfo = null ;
3232 private ?string $ instructions = null ;
3333
34- /** @var array<int, array{request_id: int, timestamp: int, timeout: int}> */
34+ /** @var array<int|string , array{request_id: int|string , timestamp: int, timeout: int}> */
3535 private array $ pendingRequests = [];
3636
37- /** @var array<int, array<string, mixed>> */
37+ /** @var array<int|string , array<string, mixed>> */
3838 private array $ responses = [];
3939
4040 /** @var array<int, array{token: string, progress: float, total: ?float, message: ?string}> */
@@ -45,7 +45,7 @@ public function nextRequestId(): int
4545 return $ this ->requestIdCounter ++;
4646 }
4747
48- public function addPendingRequest (int $ requestId , int $ timeout ): void
48+ public function addPendingRequest (int | string $ requestId , int $ timeout ): void
4949 {
5050 $ this ->pendingRequests [$ requestId ] = [
5151 'request_id ' => $ requestId ,
@@ -54,7 +54,7 @@ public function addPendingRequest(int $requestId, int $timeout): void
5454 ];
5555 }
5656
57- public function removePendingRequest (int $ requestId ): void
57+ public function removePendingRequest (int | string $ requestId ): void
5858 {
5959 unset($ this ->pendingRequests [$ requestId ]);
6060 }
@@ -64,12 +64,12 @@ public function getPendingRequests(): array
6464 return $ this ->pendingRequests ;
6565 }
6666
67- public function storeResponse (int $ requestId , array $ responseData ): void
67+ public function storeResponse (int | string $ requestId , array $ responseData ): void
6868 {
6969 $ this ->responses [$ requestId ] = $ responseData ;
7070 }
7171
72- public function consumeResponse (int $ requestId ): Response |Error |null
72+ public function consumeResponse (int | string $ requestId ): Response |Error |null
7373 {
7474 if (!isset ($ this ->responses [$ requestId ])) {
7575 return null ;
0 commit comments