feat(settings): import existing project setup

This commit is contained in:
Mohamed Boudra
2026-07-17 11:15:10 +02:00
parent a8ebd390fa
commit 8fe11e3bb0
43 changed files with 3464 additions and 48 deletions
@@ -82,6 +82,24 @@ const SourceSchema = z.discriminatedUnion("type", [
});
});
it("routes boolean discriminated-union branches with boolean switch cases", async () => {
const schema = await compileInlineSchema(`
const SourceSchema = z.discriminatedUnion("ok", [
z.object({ ok: z.literal(true), value: z.string() }),
z.object({ ok: z.literal(false), error: z.string() }),
]);
`);
expect(schema.safeParse({ ok: true, value: "yes" })).toMatchObject({
success: true,
data: { ok: true, value: "yes" },
});
expect(schema.safeParse({ ok: false, error: "no" })).toMatchObject({
success: true,
data: { ok: false, error: "no" },
});
});
it("routes tool-call-like status unions through the current sequential item union", async () => {
const schema = await compileInlineSchema(`
const ToolCallItemSchema = z.discriminatedUnion("status", [