feat(plugin): add tui.session.select API endpoint for TUI navigation (#6565)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
YeonGyu-Kim
2026-01-03 07:57:21 +09:00
committed by GitHub
parent 681a257df6
commit a3f38e0533
6 changed files with 205 additions and 2 deletions

View File

@@ -974,6 +974,7 @@ export namespace Server {
return c.json(true)
},
)
.post(
"/session/:sessionID/share",
describeRoute({
@@ -2600,6 +2601,32 @@ export namespace Server {
return c.json(true)
},
)
.post(
"/tui/select-session",
describeRoute({
summary: "Select session",
description: "Navigate the TUI to display the specified session.",
operationId: "tui.selectSession",
responses: {
200: {
description: "Session selected successfully",
content: {
"application/json": {
schema: resolver(z.boolean()),
},
},
},
...errors(400, 404),
},
}),
validator("json", TuiEvent.SessionSelect.properties),
async (c) => {
const { sessionID } = c.req.valid("json")
await Session.get(sessionID)
await Bus.publish(TuiEvent.SessionSelect, { sessionID })
return c.json(true)
},
)
.route("/tui/control", TuiRoute)
.put(
"/auth/:providerID",