diff --git a/src/agents/agent-builder.test.ts b/src/agents/agent-builder.test.ts index 56abb8ac7..f9be614aa 100644 --- a/src/agents/agent-builder.test.ts +++ b/src/agents/agent-builder.test.ts @@ -1,16 +1,15 @@ -import { describe, test, expect } from "bun:test" +import { describe, expect, test } from "bun:test" import { buildAgent } from "./agent-builder" import type { AgentFactory } from "./types" describe("#given an agent factory with mode", () => { - const mockFactory = ((model: string) => ({ + const mockFactory: AgentFactory = Object.assign((model: string) => ({ name: "test-agent", description: "Test", instructions: "test", model, temperature: 0.1, - })) as AgentFactory - mockFactory.mode = "subagent" + }), { mode: "subagent" as const }) test("#when building agent from factory", () => { const agent = buildAgent(mockFactory, "test-model") @@ -19,14 +18,13 @@ describe("#given an agent factory with mode", () => { }) describe("#given an agent factory with mode=primary", () => { - const mockFactory = ((model: string) => ({ + const mockFactory: AgentFactory = Object.assign((model: string) => ({ name: "primary-agent", description: "Primary Test", instructions: "test", model, temperature: 0.1, - })) as AgentFactory - mockFactory.mode = "primary" + }), { mode: "primary" as const }) test("#when building agent from factory", () => { const agent = buildAgent(mockFactory, "test-model") @@ -50,15 +48,14 @@ describe("#given an agent config object without mode", () => { }) describe("#given an agent factory with mode but config already has mode", () => { - const mockFactory = ((model: string) => ({ + const mockFactory: AgentFactory = Object.assign((model: string) => ({ name: "override-agent", description: "Override Test", instructions: "test", model, temperature: 0.1, - mode: "all", - })) as AgentFactory - mockFactory.mode = "subagent" + mode: "all" as const, + }), { mode: "subagent" as const }) test("#when building agent from factory", () => { const agent = buildAgent(mockFactory, "test-model") diff --git a/src/agents/builtin-agents/available-skills.test.ts b/src/agents/builtin-agents/available-skills.test.ts index 2505af5bb..fe5ea8441 100644 --- a/src/agents/builtin-agents/available-skills.test.ts +++ b/src/agents/builtin-agents/available-skills.test.ts @@ -2,10 +2,12 @@ import { describe, expect, test } from "bun:test" import { buildAvailableSkills } from "./available-skills" +type DiscoveredSkills = Parameters[0] + describe("buildAvailableSkills", () => { test("includes team-mode when team mode is enabled", () => { // given - const discoveredSkills = [] + const discoveredSkills: DiscoveredSkills = [] // when const availableSkills = buildAvailableSkills(discoveredSkills, undefined, undefined, true) @@ -16,7 +18,7 @@ describe("buildAvailableSkills", () => { test("excludes team-mode when team mode is disabled", () => { // given - const discoveredSkills = [] + const discoveredSkills: DiscoveredSkills = [] // when const availableSkills = buildAvailableSkills(discoveredSkills, undefined, undefined, false)