Comment on diff lines in the Changes view
This commit is contained in:
@@ -257,6 +257,15 @@ final class Store {
|
||||
sessions[taskId] = list
|
||||
}
|
||||
|
||||
func messageTask(_ taskId: String, _ text: String) async throws {
|
||||
let sessions = try await api.client.listSessions(path: .init(taskId: taskId)).ok.body.json
|
||||
if let live = sessions.last(where: { $0.state != .completed }) {
|
||||
_ = try await api.client.sendMessage(path: .init(sessionId: live.id), body: .json(.init(text: text))).accepted
|
||||
} else {
|
||||
_ = try await api.client.createSession(path: .init(taskId: taskId), body: .json(.init(prompt: text))).created
|
||||
}
|
||||
}
|
||||
|
||||
func loadInbox() async throws {
|
||||
let latest = claimRequest("inbox")
|
||||
let items = try await api.client.listInbox().ok.body.json
|
||||
|
||||
Reference in New Issue
Block a user