wip: tui api
This commit is contained in:
parent
01f8d3b05d
commit
5aafab118f
2 changed files with 109 additions and 396 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { Server } from "../../server/server"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import type { CommandModule } from "yargs"
|
||||
|
||||
export const GenerateCommand = {
|
||||
|
|
@ -10,6 +9,6 @@ export const GenerateCommand = {
|
|||
const dir = "gen"
|
||||
await fs.rmdir(dir, { recursive: true }).catch(() => {})
|
||||
await fs.mkdir(dir, { recursive: true })
|
||||
await Bun.write(path.join(dir, "openapi.json"), JSON.stringify(specs, null, 2))
|
||||
process.stdout.write(JSON.stringify(specs, null, 2))
|
||||
},
|
||||
} satisfies CommandModule
|
||||
|
|
|
|||
|
|
@ -705,9 +705,9 @@ export namespace Server {
|
|||
},
|
||||
)
|
||||
.post(
|
||||
"/tui/prompt",
|
||||
"/tui/append-prompt",
|
||||
describeRoute({
|
||||
description: "Send a prompt to the TUI",
|
||||
description: "Append prompt to the TUI",
|
||||
responses: {
|
||||
200: {
|
||||
description: "Prompt processed successfully",
|
||||
|
|
@ -723,7 +723,6 @@ export namespace Server {
|
|||
"json",
|
||||
z.object({
|
||||
text: z.string(),
|
||||
parts: MessageV2.Part.array(),
|
||||
}),
|
||||
),
|
||||
async (c) => c.json(await callTui(c)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue