refactor: remove passthrough() from zod schemas and make validation explicit

- Replace .passthrough() with explicit field definitions across all schemas
- Add missing optional fields (homeDir, happyHomeDir, happyLibDir, displayName)
- Refactor RawJSONLinesSchema to use structured base schema for clarity
- Improve schema validation strictness and type safety
- Update Machine interface to reflect explicit fields instead of index signature
This commit is contained in:
weishu
2026-01-23 16:04:37 +08:00
parent 6f8f44a314
commit 6567f22978
6 changed files with 82 additions and 50 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ const CodexSessionEventSchema = z.object({
timestamp: z.string().optional(),
type: z.string(),
payload: z.unknown().optional()
}).passthrough();
});
export type CodexSessionEvent = z.infer<typeof CodexSessionEventSchema>;