Skip to content

Commit d153817

Browse files
committed
Spotless
1 parent 6972a89 commit d153817

10 files changed

Lines changed: 57 additions & 60 deletions

File tree

src/main/java/com/github/copilot/CopilotClient.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ private static void cleanupCliProcess(Process process) {
397397
* receive responses. Remember to close the session when done.
398398
* <p>
399399
* A permission handler is required when creating a session. Use
400-
* {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve
401-
* all permission requests, or provide a custom handler to control permissions
400+
* {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve all
401+
* permission requests, or provide a custom handler to control permissions
402402
* selectively.
403403
*
404404
* <p>
@@ -494,8 +494,8 @@ public CompletableFuture<CopilotSession> createSession(SessionConfig config) {
494494
* conversation. The session's history is preserved.
495495
* <p>
496496
* A permission handler is required when resuming a session. Use
497-
* {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve
498-
* all permission requests, or provide a custom handler to control permissions
497+
* {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve all
498+
* permission requests, or provide a custom handler to control permissions
499499
* selectively.
500500
*
501501
* @param sessionId
@@ -659,8 +659,8 @@ public CompletableFuture<GetAuthStatusResponse> getAuthStatus() {
659659
* The cache is cleared when the client disconnects.
660660
* <p>
661661
* If an {@code onListModels} handler was provided in
662-
* {@link com.github.copilot.rpc.CopilotClientOptions}, it is called
663-
* instead of querying the CLI server. This is useful in BYOK mode.
662+
* {@link com.github.copilot.rpc.CopilotClientOptions}, it is called instead of
663+
* querying the CLI server. This is useful in BYOK mode.
664664
*
665665
* @return a future that resolves with a list of available models
666666
* @see ModelInfo
@@ -834,8 +834,7 @@ public CompletableFuture<SessionMetadata> getSessionMetadata(String sessionId) {
834834
*/
835835
public CompletableFuture<String> getForegroundSessionId() {
836836
return ensureConnected().thenCompose(connection -> connection.rpc
837-
.invoke("session.getForeground", Map.of(),
838-
com.github.copilot.rpc.GetForegroundSessionResponse.class)
837+
.invoke("session.getForeground", Map.of(), com.github.copilot.rpc.GetForegroundSessionResponse.class)
839838
.thenApply(com.github.copilot.rpc.GetForegroundSessionResponse::sessionId));
840839
}
841840

src/main/java/com/github/copilot/SystemMessageMode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public enum SystemMessageMode {
3737
* Override individual sections of the system prompt.
3838
* <p>
3939
* Use this mode with
40-
* {@link com.github.copilot.rpc.SystemMessageConfig#setSections} to
41-
* selectively replace, remove, append, prepend, or transform individual
42-
* sections of the default system prompt. An optional {@code content} string is
43-
* appended after all sections when provided.
40+
* {@link com.github.copilot.rpc.SystemMessageConfig#setSections} to selectively
41+
* replace, remove, append, prepend, or transform individual sections of the
42+
* default system prompt. An optional {@code content} string is appended after
43+
* all sections when provided.
4444
*
4545
* @since 1.2.0
4646
*/

src/main/java/com/github/copilot/package-info.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
*
1414
* <h2>Main Classes</h2>
1515
* <ul>
16-
* <li>{@link com.github.copilot.CopilotClient} - The main client for
17-
* connecting to and communicating with the Copilot CLI. Manages the lifecycle
18-
* of the CLI process and provides methods for creating sessions, querying
19-
* models, and checking authentication status.</li>
16+
* <li>{@link com.github.copilot.CopilotClient} - The main client for connecting
17+
* to and communicating with the Copilot CLI. Manages the lifecycle of the CLI
18+
* process and provides methods for creating sessions, querying models, and
19+
* checking authentication status.</li>
2020
* <li>{@link com.github.copilot.CopilotSession} - Represents a single
2121
* conversation session with Copilot. Sessions maintain context across multiple
2222
* messages and support streaming responses, tool invocations, and event
2323
* handling.</li>
24-
* <li>{@link com.github.copilot.JsonRpcClient} - Low-level JSON-RPC client
25-
* for communication with the Copilot CLI process.</li>
24+
* <li>{@link com.github.copilot.JsonRpcClient} - Low-level JSON-RPC client for
25+
* communication with the Copilot CLI process.</li>
2626
* </ul>
2727
*
2828
* <h2>Quick Start</h2>
@@ -43,8 +43,8 @@
4343
*
4444
* <h2>Related Packages</h2>
4545
* <ul>
46-
* <li>{@link com.github.copilot.generated} - Auto-generated event types
47-
* emitted during session processing</li>
46+
* <li>{@link com.github.copilot.generated} - Auto-generated event types emitted
47+
* during session processing</li>
4848
* <li>{@link com.github.copilot.rpc} - Configuration and data transfer
4949
* objects</li>
5050
* </ul>

src/main/java/com/github/copilot/rpc/CreateSessionRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* Internal request object for creating a new session.
1616
* <p>
1717
* This is a low-level class for JSON-RPC communication. For creating sessions,
18-
* use
19-
* {@link com.github.copilot.CopilotClient#createSession(SessionConfig)}.
18+
* use {@link com.github.copilot.CopilotClient#createSession(SessionConfig)}.
2019
*
2120
* @see com.github.copilot.CopilotClient#createSession(SessionConfig)
2221
* @see SessionConfig

src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,9 @@ public Consumer<SessionEvent> getOnEvent() {
743743
* Sets an event handler that is registered on the session before the
744744
* {@code session.resume} RPC is issued.
745745
* <p>
746-
* Equivalent to calling
747-
* {@link com.github.copilot.CopilotSession#on(Consumer)} immediately after
748-
* resumption, but executes earlier in the lifecycle so no events are missed.
746+
* Equivalent to calling {@link com.github.copilot.CopilotSession#on(Consumer)}
747+
* immediately after resumption, but executes earlier in the lifecycle so no
748+
* events are missed.
749749
*
750750
* @param onEvent
751751
* the event handler to register before session resumption

src/main/java/com/github/copilot/rpc/SessionConfig.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public SystemMessageConfig getSystemMessage() {
205205
* Sets the system message configuration.
206206
* <p>
207207
* The system message controls the behavior and personality of the assistant.
208-
* Use {@link com.github.copilot.SystemMessageMode#APPEND} to add
209-
* instructions while preserving default behavior, or
208+
* Use {@link com.github.copilot.SystemMessageMode#APPEND} to add instructions
209+
* while preserving default behavior, or
210210
* {@link com.github.copilot.SystemMessageMode#REPLACE} to fully customize.
211211
*
212212
* @param systemMessage
@@ -794,12 +794,12 @@ public Consumer<SessionEvent> getOnEvent() {
794794
* Sets an event handler that is registered on the session before the
795795
* {@code session.create} RPC is issued.
796796
* <p>
797-
* Equivalent to calling
798-
* {@link com.github.copilot.CopilotSession#on(Consumer)} immediately after
799-
* creation, but executes earlier in the lifecycle so no events are missed.
800-
* Using this property rather than {@code CopilotSession.on()} guarantees that
801-
* early events emitted by the CLI during session creation (e.g.
802-
* {@code session.start}) are delivered to the handler.
797+
* Equivalent to calling {@link com.github.copilot.CopilotSession#on(Consumer)}
798+
* immediately after creation, but executes earlier in the lifecycle so no
799+
* events are missed. Using this property rather than
800+
* {@code CopilotSession.on()} guarantees that early events emitted by the CLI
801+
* during session creation (e.g. {@code session.start}) are delivered to the
802+
* handler.
803803
*
804804
* @param onEvent
805805
* the event handler to register before session creation

src/main/java/com/github/copilot/rpc/package-info.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
* <h2>Client Configuration</h2>
1515
* <ul>
1616
* <li>{@link com.github.copilot.rpc.CopilotClientOptions} - Options for
17-
* configuring the {@link com.github.copilot.CopilotClient}, including CLI
18-
* path, port, transport mode, and auto-start behavior.</li>
17+
* configuring the {@link com.github.copilot.CopilotClient}, including CLI path,
18+
* port, transport mode, and auto-start behavior.</li>
1919
* </ul>
2020
*
2121
* <h2>Session Configuration</h2>
2222
* <ul>
23-
* <li>{@link com.github.copilot.rpc.SessionConfig} - Configuration for
24-
* creating a new session, including model selection, tools, system message, and
25-
* MCP server configuration.</li>
26-
* <li>{@link com.github.copilot.rpc.ResumeSessionConfig} - Configuration
27-
* for resuming an existing session.</li>
28-
* <li>{@link com.github.copilot.rpc.InfiniteSessionConfig} - Configuration
29-
* for infinite sessions with automatic context compaction.</li>
23+
* <li>{@link com.github.copilot.rpc.SessionConfig} - Configuration for creating
24+
* a new session, including model selection, tools, system message, and MCP
25+
* server configuration.</li>
26+
* <li>{@link com.github.copilot.rpc.ResumeSessionConfig} - Configuration for
27+
* resuming an existing session.</li>
28+
* <li>{@link com.github.copilot.rpc.InfiniteSessionConfig} - Configuration for
29+
* infinite sessions with automatic context compaction.</li>
3030
* <li>{@link com.github.copilot.rpc.SystemMessageConfig} - System message
3131
* customization options.</li>
3232
* </ul>
@@ -35,8 +35,8 @@
3535
* <ul>
3636
* <li>{@link com.github.copilot.rpc.MessageOptions} - Options for sending
3737
* messages, including prompt text and attachments.</li>
38-
* <li>{@link com.github.copilot.rpc.ToolDefinition} - Definition of a
39-
* custom tool that can be invoked by the assistant.</li>
38+
* <li>{@link com.github.copilot.rpc.ToolDefinition} - Definition of a custom
39+
* tool that can be invoked by the assistant.</li>
4040
* <li>{@link com.github.copilot.rpc.ToolInvocation} - Represents a tool
4141
* invocation request from the assistant.</li>
4242
* <li>{@link com.github.copilot.rpc.Attachment} - File attachment for
@@ -45,18 +45,18 @@
4545
*
4646
* <h2>Provider Configuration (BYOK)</h2>
4747
* <ul>
48-
* <li>{@link com.github.copilot.rpc.ProviderConfig} - Configuration for
49-
* using your own API keys with custom providers (OpenAI, Azure, etc.).</li>
48+
* <li>{@link com.github.copilot.rpc.ProviderConfig} - Configuration for using
49+
* your own API keys with custom providers (OpenAI, Azure, etc.).</li>
5050
* <li>{@link com.github.copilot.rpc.AzureOptions} - Azure-specific
5151
* configuration options.</li>
5252
* </ul>
5353
*
5454
* <h2>Model Information</h2>
5555
* <ul>
56-
* <li>{@link com.github.copilot.rpc.ModelInfo} - Information about an
57-
* available AI model.</li>
58-
* <li>{@link com.github.copilot.rpc.ModelCapabilities} - Model
59-
* capabilities and limits.</li>
56+
* <li>{@link com.github.copilot.rpc.ModelInfo} - Information about an available
57+
* AI model.</li>
58+
* <li>{@link com.github.copilot.rpc.ModelCapabilities} - Model capabilities and
59+
* limits.</li>
6060
* <li>{@link com.github.copilot.rpc.ModelPolicy} - Model policy and state
6161
* information.</li>
6262
* </ul>
@@ -69,10 +69,10 @@
6969
*
7070
* <h2>Permissions</h2>
7171
* <ul>
72-
* <li>{@link com.github.copilot.rpc.PermissionHandler} - Handler for
73-
* permission requests from the assistant.</li>
74-
* <li>{@link com.github.copilot.rpc.PermissionRequest} - A permission
75-
* request from the assistant.</li>
72+
* <li>{@link com.github.copilot.rpc.PermissionHandler} - Handler for permission
73+
* requests from the assistant.</li>
74+
* <li>{@link com.github.copilot.rpc.PermissionRequest} - A permission request
75+
* from the assistant.</li>
7676
* <li>{@link com.github.copilot.rpc.PermissionRequestResult} - Result of a
7777
* permission request decision.</li>
7878
* </ul>

src/test/java/com/github/copilot/CopilotSessionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,8 @@ void testSessionListFilterFluentAPI() throws Exception {
830830
var session = client
831831
.createSession(new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get();
832832

833-
var filter = new com.github.copilot.rpc.SessionListFilter().setCwd("/test/path")
834-
.setRepository("owner/repo").setBranch("main").setGitRoot("/test");
833+
var filter = new com.github.copilot.rpc.SessionListFilter().setCwd("/test/path").setRepository("owner/repo")
834+
.setBranch("main").setGitRoot("/test");
835835

836836
assertEquals("/test/path", filter.getCwd());
837837
assertEquals("owner/repo", filter.getRepository());

src/test/java/com/github/copilot/ModuleDescriptorTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ void sdkHasExplicitModuleDescriptor() {
2020

2121
ModuleDescriptor descriptor = module.getDescriptor();
2222
assertTrue(descriptor.exports().stream().anyMatch(export -> export.source().equals("com.github.copilot")));
23-
assertTrue(descriptor.exports().stream()
24-
.anyMatch(export -> export.source().equals("com.github.copilot.rpc")));
23+
assertTrue(descriptor.exports().stream().anyMatch(export -> export.source().equals("com.github.copilot.rpc")));
2524
assertTrue(descriptor.requires().stream()
2625
.anyMatch(require -> require.name().equals("com.fasterxml.jackson.databind")));
2726
}

src/test/java/com/github/copilot/generated/GeneratedEventTypesCoverageTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
/**
1717
* Deserialization tests for generated session event types that are not covered
18-
* in {@link com.github.copilot.SessionEventDeserializationTest}. Verifies
19-
* that each event deserializes correctly from JSON and that the {@code type}
18+
* in {@link com.github.copilot.SessionEventDeserializationTest}. Verifies that
19+
* each event deserializes correctly from JSON and that the {@code type}
2020
* discriminator and {@code data} fields are accessible.
2121
*/
2222
public class GeneratedEventTypesCoverageTest {

0 commit comments

Comments
 (0)