Initial Daily Campaign Agent release

This commit is contained in:
joliehill294-hue
2026-09-16 21:00:13 +08:00
commit 14fc94b3f0
86 changed files with 10766 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import { describe, expect, it } from "vitest";
import { apiErrorSchema, harnessEventSchema, messageInputSchema, modelConnectionInputSchema } from "../src/index.js";
describe("shared schemas", () => {
it("parses a discriminated HarnessEvent", () => expect(harnessEventSchema.parse({ eventId: "e1", sessionId: "s1", timestamp: new Date().toISOString(), sequence: 1, type: "run.started", payload: { runId: "r1" } }).type).toBe("run.started"));
it("strictly validates model config", () => expect(() => modelConnectionInputSchema.parse({ providerId: "openai", api: "bad", modelId: "x", supportsImages: false })).toThrow());
it("requires text or attachment", () => expect(() => messageInputSchema.parse({ text: "", attachmentIds: [] })).toThrow());
it("parses unified errors", () => expect(apiErrorSchema.parse({ error: { code: "X", message: "safe", requestId: "req_1", details: {} } }).error.code).toBe("X"));
});