feat(id): brand SessionID through Drizzle and Zod schemas (#16953)

This commit is contained in:
Kit Langton
2026-03-11 19:16:56 -04:00
committed by GitHub
parent 4e73473119
commit cb67465675
44 changed files with 226 additions and 158 deletions

View File

@@ -1,5 +1,6 @@
import type { Argv } from "yargs"
import { Session } from "../../session"
import { SessionID } from "../../session/schema"
import { cmd } from "./cmd"
import { bootstrap } from "../bootstrap"
import { UI } from "../ui"
@@ -17,7 +18,7 @@ export const ExportCommand = cmd({
},
handler: async (args) => {
await bootstrap(process.cwd(), async () => {
let sessionID = args.sessionID
let sessionID = args.sessionID ? SessionID.make(args.sessionID) : undefined
process.stderr.write(`Exporting session: ${sessionID ?? "latest"}\n`)
if (!sessionID) {
@@ -58,7 +59,7 @@ export const ExportCommand = cmd({
throw new UI.CancelledError()
}
sessionID = selectedSession as string
sessionID = selectedSession
prompts.outro("Exporting session...", {
output: process.stderr,
@@ -67,7 +68,7 @@ export const ExportCommand = cmd({
try {
const sessionInfo = await Session.get(sessionID!)
const messages = await Session.messages({ sessionID: sessionID! })
const messages = await Session.messages({ sessionID: sessionInfo.id })
const exportData = {
info: sessionInfo,