wip: bash

This commit is contained in:
Dax Raad
2025-08-13 13:31:29 -04:00
parent 7505fa61b9
commit c6344c5714
2 changed files with 4 additions and 4 deletions

View File

@@ -593,10 +593,10 @@ export namespace Server {
}, },
) )
.post( .post(
"/session/:id/command", "/session/:id/bash",
describeRoute({ describeRoute({
description: "Run a bash command", description: "Run a bash command",
operationId: "session.chat", operationId: "session.bash",
responses: { responses: {
200: { 200: {
description: "Created message", description: "Created message",
@@ -618,7 +618,7 @@ export namespace Server {
async (c) => { async (c) => {
const sessionID = c.req.valid("param").id const sessionID = c.req.valid("param").id
const body = c.req.valid("json") const body = c.req.valid("json")
const msg = await Session.command({ ...body, sessionID }) const msg = await Session.bash({ ...body, sessionID })
return c.json(msg) return c.json(msg)
}, },
) )

View File

@@ -1005,7 +1005,7 @@ export namespace Session {
command: z.string(), command: z.string(),
}) })
export type CommandInput = z.infer<typeof CommandInput> export type CommandInput = z.infer<typeof CommandInput>
export async function command(input: CommandInput) { export async function bash(input: CommandInput) {
using abort = lock(input.sessionID) using abort = lock(input.sessionID)
const msg: MessageV2.Assistant = { const msg: MessageV2.Assistant = {
id: Identifier.ascending("message"), id: Identifier.ascending("message"),