Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

perf(ui): keep the WS schemas on zod v3 — v4 measured bigger

Harald1814e97cf438
diff --git a/jarvis/ui/web/frontend/src/schema/ws.ts b/jarvis/ui/web/frontend/src/schema/ws.ts
index 7175540955..a5644d0960 100644
--- a/jarvis/ui/web/frontend/src/schema/ws.ts
+++ b/jarvis/ui/web/frontend/src/schema/ws.ts
@@ -1,8 +1,8 @@
-// zod v4's core, which the installed zod 3.25 ships alongside v3 under this
-// subpath. Same API for everything below, a fraction of the bytes — and these
-// schemas sit in the STARTUP chunk because the socket opens as the app mounts,
-// so what zod costs here is paid before the first paint.
-import { z } from "zod/v4";
+// Stays on zod v3, deliberately. These schemas sit in the STARTUP chunk (the
+// socket opens as the app mounts), so their cost is paid before the first
+// paint and `zod/v4` looked like free savings. Measured on the real bundle it
+// is the opposite: v4's core added ~30 KB here. Re-measure before trying again.
+import { z } from "zod";
/** Envelope emitted by server over /ws for every bus-event.
*
@@ -15,7 +15,7 @@ export const WSEventEnvelope = z.object({
source_layer: z.string().default(""),
timestamp_ns: z.number(),
trace_id: z.string(),
- payload: z.record(z.string(), z.unknown()).default({}),
+ payload: z.record(z.unknown()).default({}),
});
export type WSEventEnvelopeT = z.infer<typeof WSEventEnvelope>;
@@ -39,7 +39,7 @@ export const WSMessageIn = z.object({
type: z.literal("message"),
kind: z.enum(["text", "voice", "system", "action"]),
content: z.string(),
- metadata: z.record(z.string(), z.unknown()).optional(),
+ metadata: z.record(z.unknown()).optional(),
});
export type WSMessageInT = z.infer<typeof WSMessageIn>;
@@ -61,7 +61,7 @@ export const WSCommand = z.object({
// task into the live conversation context.
"mission.inject",
]),
- payload: z.record(z.string(), z.unknown()).default({}),
+ payload: z.record(z.unknown()).default({}),
});
export type WSCommandT = z.infer<typeof WSCommand>;