This commit is contained in:
Frank 2025-08-17 14:33:40 +08:00
parent c5b3f54a0a
commit 26d2e23a3e

View file

@ -435,6 +435,8 @@ async function getUserPrompt() {
} }
function subscribeSessionEvents() { function subscribeSessionEvents() {
console.log("Subscribing to session events...")
const TOOL: Record<string, [string, string]> = { const TOOL: Record<string, [string, string]> = {
todowrite: ["Todo", "\x1b[33m\x1b[1m"], todowrite: ["Todo", "\x1b[33m\x1b[1m"],
todoread: ["Todo", "\x1b[33m\x1b[1m"], todoread: ["Todo", "\x1b[33m\x1b[1m"],
@ -454,8 +456,11 @@ function subscribeSessionEvents() {
let text = "" let text = ""
;(async () => { ;(async () => {
// TODO
console.log("Subscribing to session events: fetching...")
const response = await fetch(`${server.url}/event`) const response = await fetch(`${server.url}/event`)
if (!response.body) throw new Error("No response body") if (!response.body) throw new Error("No response body")
console.log("Subscribing to session events: fetched")
const reader = response.body.getReader() const reader = response.body.getReader()
const decoder = new TextDecoder() const decoder = new TextDecoder()