(rawCommand: string)
| 254 | } |
| 255 | |
| 256 | const runCommand = async (rawCommand: string) => { |
| 257 | const command = getSlashCommand(rawCommand) |
| 258 | setMode("input") |
| 259 | setInput("") |
| 260 | |
| 261 | switch (command) { |
| 262 | case "/help": |
| 263 | setInput("/") |
| 264 | setMode("command") |
| 265 | break |
| 266 | case "/model": |
| 267 | await openModelPicker() |
| 268 | break |
| 269 | case "/local": |
| 270 | await switchExecutionMode("local") |
| 271 | break |
| 272 | case "/cloud": |
| 273 | await switchExecutionMode("cloud") |
| 274 | break |
| 275 | case "/reset": |
| 276 | await resetAgent() |
| 277 | break |
| 278 | case "/exit": |
| 279 | case "/quit": |
| 280 | exitApp() |
| 281 | break |
| 282 | default: |
| 283 | addEntry("error", "command", `Unknown command: ${rawCommand}. Type /help.`) |
| 284 | break |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | const openModelPicker = async () => { |
| 289 | const session = sessionRef.current |
no test coverage detected