feat: implement todo tracking with collapsible status row and update event handling

This commit is contained in:
Bohdan Triapitsyn
2025-12-16 02:34:29 +02:00
parent ca898cf321
commit 8f6e6db5c5
7 changed files with 421 additions and 51 deletions
+31
View File
@@ -349,6 +349,37 @@ class OpencodeService {
return response.data || [];
}
async getSessionTodos(sessionId: string): Promise<Array<{ id: string; content: string; status: string; priority: string }>> {
try {
const base = this.baseUrl.replace(/\/$/, "");
const url = new URL(`${base}/session/${encodeURIComponent(sessionId)}/todo`);
if (this.currentDirectory && this.currentDirectory.length > 0) {
url.searchParams.set("directory", this.currentDirectory);
}
const response = await fetch(url.toString(), {
method: "GET",
headers: {
Accept: "application/json",
},
});
if (!response.ok) {
return [];
}
const data = await response.json().catch(() => null);
if (!data || !Array.isArray(data)) {
return [];
}
return data as Array<{ id: string; content: string; status: string; priority: string }>;
} catch {
return [];
}
}
async sendMessage(params: {
id: string;
providerID: string;