diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ab2fe7fa9..295a9f0ef 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -215,14 +215,14 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: '3.11' + python-version: '3.12' cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e . - pip install pytest pytest-asyncio pytest-cov + pip install -e ".[all]" + pip install pytest pytest-asyncio pytest-cov httpx - name: Run unit tests run: | diff --git a/components/frontend/src/components/claude-agent-options/_components/agents-editor.tsx b/components/frontend/src/components/claude-agent-options/_components/agents-editor.tsx new file mode 100644 index 000000000..e1d98ec65 --- /dev/null +++ b/components/frontend/src/components/claude-agent-options/_components/agents-editor.tsx @@ -0,0 +1,63 @@ +"use client"; + +import { Plus, Trash2 } from "lucide-react"; +import type { z } from "zod"; + +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Textarea } from "@/components/ui/textarea"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + +import type { agentDefinitionSchema } from "../schema"; +import { StringListEditor } from "./string-list-editor"; + +type AgentDef = z.infer; + +export function AgentsEditor({ value, onChange }: { value: Record; onChange: (v: Record) => void }) { + const entries = Object.entries(value); + const addAgent = () => onChange({ ...value, [`agent-${entries.length + 1}`]: { description: "", prompt: "" } }); + const removeAgent = (name: string) => { const next = { ...value }; delete next[name]; onChange(next); }; + const updateAgentName = (oldName: string, newName: string) => { + const next: Record = {}; + for (const [k, v] of Object.entries(value)) next[k === oldName ? newName : k] = v; + onChange(next); + }; + const updateAgent = (name: string, agent: AgentDef) => onChange({ ...value, [name]: agent }); + + return ( +
+

Define custom sub-agents with their own prompt, tools, and model.

+ {entries.map(([name, agent]) => ( +
+
+ updateAgentName(name, e.target.value)} /> + + +
+ updateAgent(name, { ...agent, description: e.target.value })} /> +