Skip to content

Commit e7254fa

Browse files
committed
docs: complete SDK Javadoc and core flow comments
1 parent e8cb8a8 commit e7254fa

61 files changed

Lines changed: 2960 additions & 319 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/io/github/easy4j/opencode/HttpCallCancellation.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
/**
44
* Binds a business-layer cancellation signal to a single OpenCode HTTP call.
5-
*
65
* <p>Implementations allow callers to register a cancellation callback that will be invoked
76
* when the underlying HTTP call should be aborted. The {@link #onCancel(Runnable)} method
87
* returns an {@link AutoCloseable} that, when closed, unregisters the callback.</p>
98
*
10-
* @author [@Loong Wan](https://github.com/loong10k)
11-
* @since 3.0.0
9+
* @author <a href="https://github.com/loong10k">Loong Wan</a>
10+
* @since 1.0.0
1211
* @see io.github.easy4j.opencode.api.OpenCodeHttpClient
1312
*/
1413
@FunctionalInterface
@@ -18,14 +17,14 @@ public interface HttpCallCancellation {
1817
* Registers a cancellation callback and returns a handle to unregister it.
1918
*
2019
* @param callback the runnable to invoke when cancellation is requested
21-
* @return an {@link AutoCloseable} that unregisters the callback when closed
20+
* @return OpenCode SDK 返回的回调注销句柄对象
2221
*/
2322
AutoCloseable onCancel(Runnable callback);
2423

2524
/**
2625
* Returns whether this cancellation has been triggered.
2726
*
28-
* @return {@code true} if cancellation has been requested, {@code false} otherwise
27+
* @return 满足条件返回 {@code true},否则返回 {@code false}
2928
*/
3029
default boolean isCancelled() {
3130
return false;

src/main/java/io/github/easy4j/opencode/HttpResponseMode.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22

33
/**
44
* HTTP 对话响应模式。
5+
*
6+
* @author <a href="https://github.com/loong10k">Loong Wan</a>
7+
* @since 1.0.0
58
*/
69
public enum HttpResponseMode {
710

8-
/** 等待完整响应后一次性返回。 */
11+
/**
12+
* blocking枚举值。
13+
*/
914
BLOCKING,
1015

11-
/** 消费 Provider SSE 并逐段回调。 */
16+
/**
17+
* stream枚举值。
18+
*/
1219
STREAM,
1320

14-
/** 由调用方根据结构化输出等请求特征选择。 */
21+
/**
22+
* auto枚举值。
23+
*/
1524
AUTO
1625
}

src/main/java/io/github/easy4j/opencode/OpenCodeCliConfig.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
/**
66
* Configuration for the local OpenCode CLI subsystem.
7-
*
87
* <p>Covers local {@code opencode} executable path, timeouts, working directory,
98
* and other CLI runtime settings. Can be mapped from Spring
109
* {@code @ConfigurationProperties}.</p>
1110
*
12-
* @author [@Loong Wan](https://github.com/loong10k)
13-
* @since 3.0.0
11+
* @author <a href="https://github.com/loong10k">Loong Wan</a>
12+
* @since 1.0.0
1413
* @see OpenCodeClient
1514
* @see OpenCodeClientConfig
1615
*/

0 commit comments

Comments
 (0)