upd: writing cli

This commit is contained in:
2023-12-12 07:01:21 +00:00
parent 02767aae04
commit a7fcafca83
5 changed files with 64 additions and 16 deletions

View File

@ -74,11 +74,11 @@ memoryriver类维护一个缓存简单地缓存高频访问和连续访问
# 用户交互设计
## 内部命令
- `# OpenSession`:向调度模块申请一个新会话
- `# CloseSession [SessionToken] [OuthenticationKey]`:显示地告知调度模块停止某个会话
- `# ReRequest [SessionToken] [OperationToken] [OuthenticationKey]`:向服务端重新请求调取某次操作响应的缓存
- `# Request [SessionToken] [OuthenticationKey] # [UserCommand]`:向后端发送一个请求
- `# ShutDownSystem`:关闭整个系统
- `#OpenSession [TempChannelID]`:向调度模块申请一个新会话
- `#CloseSession [SessionToken] [OuthenticationKey]`:显示地告知调度模块停止某个会话
- `#_Request [SessionToken] [OperationToken] [OuthenticationKey]`:向服务端重新请求调取某次操作响应的缓存
- `#Request [SessionToken] [OperationToken] [OuthenticationKey] [UserCommand]`:向后端发送一个请求
- `#ShutDownSystem`:关闭整个系统
## 向用户提供的命令
- `quit``exit`:正常退出系统
@ -107,7 +107,7 @@ memoryriver类维护一个缓存简单地缓存高频访问和连续访问
- WebUI图形界面
## 响应
注意对于申请Session时响应用`[TempChannelID]`替代`[SessionToken]`,返回信息内容是`[SessionToken]``[AuthenticationKey]`
注意对于申请Session时响应用`[TempChannelID]`替代`[SessionToken]`仅用于保证信息投递正确,返回信息内容是`[SessionToken]``[AuthenticationKey]`
- 引擎返回:`std::string`
- 调度模块返回:字符串,`[SessionToken] [OperationToken] [LineCounter]\n[ResponseContent]`,其中,`[ResponseContent]`恰有`[LineCounter]`行,每行行末有且仅有一个`\n`。输出为空通过把`[LineCounter]`设置为0来实现。
- 内置交互模块interactive模式返回字符串`[ResponseContent]`