| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- import { z } from 'zod';
- export interface InterviewQuestion {
- id: string;
- question: string;
- options: string[];
- suggested?: string;
- }
- export interface InterviewAnswer {
- questionId: string;
- answer: string;
- }
- export interface InterviewAssistantState {
- summary: string;
- title?: string;
- questions: InterviewQuestion[];
- }
- // ─── Zod Schemas (for validating untrusted LLM output) ─────────────
- /** Raw question object from LLM output - loose, everything optional. */
- export const RawQuestionSchema = z.object({
- id: z.string().optional(),
- question: z.string().optional(),
- options: z.array(z.unknown()).optional(),
- suggested: z.unknown().optional(),
- });
- /** Raw interview_state block from LLM output. */
- export const RawInterviewStateSchema = z.object({
- summary: z.unknown().optional(),
- title: z.unknown().optional(),
- questions: z.array(z.unknown()).optional(),
- });
- // ─── Interfaces ─────────────────────────────────────────────────────
- export interface InterviewRecord {
- id: string;
- sessionID: string;
- idea: string;
- markdownPath: string;
- createdAt: string;
- abandonedAt?: string;
- abandonedOrder?: number;
- status: 'active' | 'abandoned';
- baseMessageCount: number;
- }
- export interface InterviewMessagePart {
- type?: string;
- text?: string;
- }
- export interface InterviewMessage {
- info?: {
- role?: string;
- [key: string]: unknown;
- };
- parts?: InterviewMessagePart[];
- }
- export interface InterviewListItem {
- id: string;
- idea: string;
- status: InterviewRecord['status'];
- createdAt: string;
- }
- export interface InterviewFileItem {
- fileName: string;
- resumeCommand: string;
- title: string;
- summary: string;
- sessionID?: string;
- directory?: string;
- }
- export interface SpecBlock {
- id: string;
- title: string;
- content: string;
- }
- export interface InterviewState {
- interview: InterviewRecord;
- url: string;
- markdownPath: string;
- mode:
- | 'awaiting-agent'
- | 'awaiting-user'
- | 'abandoned'
- | 'completed'
- | 'error'
- | 'session-disconnected';
- lastParseError?: string;
- isBusy: boolean;
- summary: string;
- questions: InterviewQuestion[];
- document: string;
- blocks: SpecBlock[];
- }
- /** Wire format for dashboard state cache entries. */
- export interface InterviewStateEntry {
- interviewId: string;
- sessionID: string;
- idea: string;
- mode:
- | 'awaiting-agent'
- | 'awaiting-user'
- | 'abandoned'
- | 'completed'
- | 'error'
- | 'session-disconnected';
- summary: string;
- title: string;
- questions: Array<{
- id: string;
- question: string;
- options?: string[];
- suggested?: string;
- }>;
- pendingAnswers: Array<{
- questionId: string;
- answer: string;
- }> | null;
- lastUpdatedAt: number;
- filePath: string;
- nudgeAction: 'more-questions' | 'confirm-complete' | null;
- pendingBlockComment: {
- section: string;
- comment: string;
- } | null;
- pendingChatMessage: string | null;
- document?: string;
- blocks?: SpecBlock[];
- }
|