|
33 | 33 | import com.github.copilot.sdk.json.CreateSessionRequest; |
34 | 34 | import com.github.copilot.sdk.json.CreateSessionResponse; |
35 | 35 | import com.github.copilot.sdk.json.DeleteSessionResponse; |
| 36 | +import com.github.copilot.sdk.json.GetAuthStatusResponse; |
36 | 37 | import com.github.copilot.sdk.json.GetLastSessionIdResponse; |
| 38 | +import com.github.copilot.sdk.json.GetModelsResponse; |
| 39 | +import com.github.copilot.sdk.json.GetStatusResponse; |
37 | 40 | import com.github.copilot.sdk.json.ListSessionsResponse; |
| 41 | +import com.github.copilot.sdk.json.ModelInfo; |
38 | 42 | import com.github.copilot.sdk.json.PermissionRequestResult; |
39 | 43 | import com.github.copilot.sdk.json.PingResponse; |
40 | 44 | import com.github.copilot.sdk.json.ResumeSessionConfig; |
@@ -537,6 +541,40 @@ public CompletableFuture<PingResponse> ping(String message) { |
537 | 541 | Map.of("message", message != null ? message : ""), PingResponse.class)); |
538 | 542 | } |
539 | 543 |
|
| 544 | + /** |
| 545 | + * Gets CLI status including version and protocol information. |
| 546 | + * |
| 547 | + * @return a future that resolves with the status response containing version |
| 548 | + * and protocol version |
| 549 | + * @see GetStatusResponse |
| 550 | + */ |
| 551 | + public CompletableFuture<GetStatusResponse> getStatus() { |
| 552 | + return ensureConnected() |
| 553 | + .thenCompose(connection -> connection.rpc.invoke("status.get", Map.of(), GetStatusResponse.class)); |
| 554 | + } |
| 555 | + |
| 556 | + /** |
| 557 | + * Gets current authentication status. |
| 558 | + * |
| 559 | + * @return a future that resolves with the authentication status |
| 560 | + * @see GetAuthStatusResponse |
| 561 | + */ |
| 562 | + public CompletableFuture<GetAuthStatusResponse> getAuthStatus() { |
| 563 | + return ensureConnected().thenCompose( |
| 564 | + connection -> connection.rpc.invoke("auth.getStatus", Map.of(), GetAuthStatusResponse.class)); |
| 565 | + } |
| 566 | + |
| 567 | + /** |
| 568 | + * Lists available models with their metadata. |
| 569 | + * |
| 570 | + * @return a future that resolves with a list of available models |
| 571 | + * @see ModelInfo |
| 572 | + */ |
| 573 | + public CompletableFuture<List<ModelInfo>> listModels() { |
| 574 | + return ensureConnected().thenCompose(connection -> connection.rpc |
| 575 | + .invoke("models.list", Map.of(), GetModelsResponse.class).thenApply(GetModelsResponse::getModels)); |
| 576 | + } |
| 577 | + |
540 | 578 | /** |
541 | 579 | * Gets the ID of the most recently used session. |
542 | 580 | * <p> |
|
0 commit comments