Reapply "feat(desktop): terminal pane (#5081)"

This reverts commit f9dcd97936.
This commit is contained in:
Adam
2025-12-04 20:32:08 -06:00
parent d82bd430f6
commit 09f522f0aa
26 changed files with 2299 additions and 402 deletions

View File

@@ -0,0 +1,36 @@
import { resolver } from "hono-openapi"
import z from "zod"
import { Storage } from "../storage/storage"
export const ERRORS = {
400: {
description: "Bad request",
content: {
"application/json": {
schema: resolver(
z
.object({
data: z.any(),
errors: z.array(z.record(z.string(), z.any())),
success: z.literal(false),
})
.meta({
ref: "BadRequestError",
}),
),
},
},
},
404: {
description: "Not found",
content: {
"application/json": {
schema: resolver(Storage.NotFoundError.Schema),
},
},
},
} as const
export function errors(...codes: number[]) {
return Object.fromEntries(codes.map((code) => [code, ERRORS[code as keyof typeof ERRORS]]))
}