feat: add plan mode with enter/exit tools (#8281)

This commit is contained in:
Dax
2026-01-13 15:55:48 -05:00
committed by GitHub
parent 66b7a4991e
commit 0a3c72d678
16 changed files with 824 additions and 46 deletions

View File

@@ -196,6 +196,23 @@ export function Session() {
}
})
let lastSwitch: string | undefined = undefined
sdk.event.on("message.part.updated", (evt) => {
const part = evt.properties.part
if (part.type !== "tool") return
if (part.sessionID !== route.sessionID) return
if (part.state.status !== "completed") return
if (part.id === lastSwitch) return
if (part.tool === "plan_exit") {
local.agent.set("build")
lastSwitch = part.id
} else if (part.tool === "plan_enter") {
local.agent.set("plan")
lastSwitch = part.id
}
})
let scroll: ScrollBoxRenderable
let prompt: PromptRef
const keybind = useKeybind()