-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVersionSlashCommand.java
More file actions
33 lines (26 loc) · 900 Bytes
/
Copy pathVersionSlashCommand.java
File metadata and controls
33 lines (26 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.example.codingagent.cli.chat.command;
import com.example.codingagent.runtime.StatusSummaryService;
import org.springframework.stereotype.Component;
/**
* 输出当前会话运行版本。
*/
@Component
public class VersionSlashCommand implements ChatSlashCommand {
private final StatusSummaryService statusSummaryService;
public VersionSlashCommand(StatusSummaryService statusSummaryService) {
this.statusSummaryService = statusSummaryService;
}
@Override
public String name() {
return "version";
}
@Override
public String description() {
return "查看当前会话运行版本";
}
@Override
public ChatSlashCommandResult execute(ChatSlashCommandRequest request) {
String version = statusSummaryService.currentVersion();
return ChatSlashCommandResult.output(java.util.List.of(version));
}
}