Skip to content

Commit 350aa64

Browse files
committed
docs: refine protocol field semantics
1 parent c20257d commit 350aa64

25 files changed

Lines changed: 54 additions & 54 deletions

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
public enum HttpResponseMode {
1010

1111
/**
12-
* blocking枚举值
12+
* 等待响应体完整读取后再返回,适用于普通同步 REST 调用
1313
*/
1414
BLOCKING,
1515

1616
/**
17-
* stream枚举值
17+
* 保持响应连接并逐段消费数据,适用于 SSE 或其他流式响应
1818
*/
1919
STREAM,
2020

2121
/**
22-
* auto枚举值
22+
* 由具体 API 根据端点类型自动选择缓冲或流式模式
2323
*/
2424
AUTO
2525
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class OpenCodeClient implements AutoCloseable {
6969
*/
7070
private final OpenCodeSseClient sseClient;
7171
/**
72-
* OpenCode 协议字段 {@code cli};Java 类型为 {@code OpenCodeCli}。
72+
* 本地 CLI 操作门面;CLI 子系统禁用时为 {@code null}。
7373
*/
7474
private final OpenCodeCli cli;
7575
/**

src/main/java/io/github/easy4j/opencode/api/mapper/OpenCodeCallbackParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class OpenCodeCallbackParser {
3535
*/
3636
private static final Logger log = LoggerFactory.getLogger(OpenCodeCallbackParser.class);
3737
/**
38-
* OpenCode 协议字段 {@code MAPPER};Java 类型为 {@code ObjectMapper}
38+
* 用于解析回调 JSON 的共享映射器,允许注释并忽略服务端新增字段
3939
*/
4040
private static final ObjectMapper MAPPER = new ObjectMapper()
4141
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

src/main/java/io/github/easy4j/opencode/api/model/FileContent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class FileContent {
1717

1818
/**
19-
* OpenCode 协议中的类型判别值
19+
* 文件内容类型,例如文本或二进制
2020
*/
2121
private String type;
2222

src/main/java/io/github/easy4j/opencode/api/model/FileDiff.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class FileDiff {
2121
private String path;
2222

2323
/**
24-
* OpenCode 协议字段 {@code oldPath};Java 类型为 {@code String}
24+
* 文件重命名或移动前的旧路径;其他差异类型为空
2525
*/
2626
@JsonProperty("oldPath")
2727
private String oldPath;

src/main/java/io/github/easy4j/opencode/api/model/FormatterStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class FormatterStatus {
2525
private Boolean enabled;
2626

2727
/**
28-
* OpenCode 协议字段 {@code command};Java 类型为 {@code String}
28+
* 启动该格式化器时使用的命令行
2929
*/
3030
private String command;
3131
}

src/main/java/io/github/easy4j/opencode/api/model/LspStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class LspStatus {
2727
private String name;
2828

2929
/**
30-
* OpenCode 协议字段 {@code root};Java 类型为 {@code String}
30+
* 语言服务器绑定的项目根目录
3131
*/
3232
private String root;
3333

src/main/java/io/github/easy4j/opencode/api/model/MessageInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public class MessageInfo {
1818

1919
/**
20-
* OpenCode 协议字段 {@code info};Java 类型为 {@code Message}
20+
* 目标消息的角色、时间和会话归属等元数据
2121
*/
2222
private Message info;
2323

src/main/java/io/github/easy4j/opencode/api/model/OpenCodePath.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
public class OpenCodePath {
1717

1818
/**
19-
* OpenCode 协议字段 {@code home};Java 类型为 {@code String}
19+
* 当前用户的主目录路径
2020
*/
2121
private String home;
2222

2323
/**
24-
* OAuth 防重放状态值
24+
* OpenCode 持久化运行状态目录
2525
*/
2626
private String state;
2727

@@ -31,17 +31,17 @@ public class OpenCodePath {
3131
private String config;
3232

3333
/**
34-
* OpenCode 协议字段 {@code directory};Java 类型为 {@code String}
34+
* 当前 OpenCode Server 实例的工作目录
3535
*/
3636
private String directory;
3737

3838
/**
39-
* OpenCode 协议字段 {@code worktree};Java 类型为 {@code String}
39+
* 当前项目工作树根目录
4040
*/
4141
private String worktree;
4242

4343
/**
44-
* OpenCode 协议字段 {@code worktreeDir};Java 类型为 {@code String}
44+
* 服务端返回的工作树目录兼容字段
4545
*/
4646
@JsonProperty("worktree_dir")
4747
private String worktreeDir;

src/main/java/io/github/easy4j/opencode/api/model/Part.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
public class Part {
1717

1818
/**
19-
* OpenCode 协议中的类型判别值
19+
* 消息片段类型,例如 {@code text}、{@code tool_use} 或 {@code tool_result}
2020
*/
2121
private String type;
2222
/**
23-
* OpenCode 协议字段 {@code text};Java 类型为 {@code String}
23+
* 文本类型消息片段的正文;非文本片段可能为空
2424
*/
2525
private String text;
2626

0 commit comments

Comments
 (0)