refactor(native-chat): give the answered-turn schema its own module

Keeps the journal schema file within its line limit.
This commit is contained in:
Brennan Benson
2026-10-05 09:44:37 -07:00
parent 202138855d
commit e02f98add5
2 changed files with 9 additions and 5 deletions
@@ -0,0 +1,7 @@
import { z } from 'zod'
/** A submission's answered turn as published. `via` is a string, as `dispatchState` is: a newer
* host may name another way of joining. null: the host recorded no turn. */
export const AgentJournalAnsweredTurnSchema = z
.object({ turnItemId: z.string().min(1), via: z.string().min(1) })
.nullable()
+2 -5
View File
@@ -16,6 +16,7 @@
import { z } from 'zod'
import { AgentSessionContextUsageSchema } from './agent-session-context-usage-schema'
import { AgentSessionFailureFactSchema } from './agent-session-failure-fact-schema'
import { AgentJournalAnsweredTurnSchema } from './agent-session-answered-turn-schema'
import type {
AgentJournalItemBody,
AgentJournalMessageItem,
@@ -319,11 +320,7 @@ export const AgentJournalSubmissionSchema = z.object({
submittedAt: z.number(),
resolvedAt: z.number().nullable(),
submittedSequence: z.number().int().optional(),
// `via` is a string, as `dispatchState` is: a newer host may name another way of joining.
answeredInTurn: z
.object({ turnItemId: z.string().min(1), via: z.string().min(1) })
.nullable()
.optional(),
answeredInTurn: AgentJournalAnsweredTurnSchema.optional(),
recovered: z.literal(true).optional(),
handoverRecorded: z.literal(true).optional(),
handedOverAt: z.number().optional(),