modes concept

This commit is contained in:
Dax Raad
2025-07-09 15:44:59 -04:00
parent fd4a5d5a63
commit a826936702
6 changed files with 140 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ import { Config } from "../config/config"
import { File } from "../file"
import { LSP } from "../lsp"
import { MessageV2 } from "../session/message-v2"
import { Mode } from "../session/mode"
const ERRORS = {
400: {
@@ -681,6 +682,26 @@ export namespace Server {
return c.json(true)
},
)
.get(
"/mode",
describeRoute({
description: "List all modes",
responses: {
200: {
description: "List of modes",
content: {
"application/json": {
schema: resolver(Mode.Info.array()),
},
},
},
},
}),
async (c) => {
const modes = await Mode.list()
return c.json(modes)
},
)
return result
}