diff --git a/src/server/errors.ts b/src/server/errors.ts index af56c4584..e1ed18936 100644 --- a/src/server/errors.ts +++ b/src/server/errors.ts @@ -1,4 +1,5 @@ import type { Context } from 'hono' +import type { ContentfulStatusCode } from 'hono/utils/http-status' import { HTTPException } from 'hono/http-exception' export class ServeError extends Error { @@ -42,18 +43,18 @@ export function sessionError(message: string): ServeError { export function errorHandler(err: Error, c: Context) { if (err instanceof ServeError) { - return c.json(err.json(), { status: err.status }) + return c.json(err.json(), { status: err.status as ContentfulStatusCode }) } if (err instanceof HTTPException) { return c.json( { error: 'HTTP_ERROR', message: err.message }, - { status: err.status }, + { status: err.status as ContentfulStatusCode }, ) } const message = err instanceof Error && err.stack ? err.stack : err.toString() return c.json( { error: 'INTERNAL', message }, - { status: 500 }, + { status: 500 as ContentfulStatusCode }, ) } diff --git a/src/server/server.ts b/src/server/server.ts index 7599c965d..3140570b3 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -20,7 +20,7 @@ export function startServer( config: ServerConfig, sessionManager: SessionManager, eventBus: EventBus, -): BunServer & { port?: number } { +): BunServer & { port?: number } { eventBus.startHeartbeat() const app = new Hono() diff --git a/src/server/transcriptReader.ts b/src/server/transcriptReader.ts index 4c48a92bc..7d00a82d4 100644 --- a/src/server/transcriptReader.ts +++ b/src/server/transcriptReader.ts @@ -21,6 +21,10 @@ type TranscriptEntry = { content?: unknown } content?: unknown + compactMetadata?: { + preservedSegment?: unknown + [key: string]: unknown + } [key: string]: unknown }