2026-02-17 20:07:30 -06:00
|
|
|
import { useState, useEffect } from "react";
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
|
|
import { useNavigate } from "react-router-dom";
|
|
|
|
|
import { useDialog } from "../context/DialogContext";
|
|
|
|
|
import { useCompany } from "../context/CompanyContext";
|
|
|
|
|
import { agentsApi } from "../api/agents";
|
|
|
|
|
import { queryKeys } from "../lib/queryKeys";
|
2026-02-17 20:07:30 -06:00
|
|
|
import { AGENT_ROLES } from "@paperclip/shared";
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
import {
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogContent,
|
|
|
|
|
} from "@/components/ui/dialog";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import {
|
|
|
|
|
Popover,
|
|
|
|
|
PopoverContent,
|
|
|
|
|
PopoverTrigger,
|
|
|
|
|
} from "@/components/ui/popover";
|
2026-02-17 13:24:33 -06:00
|
|
|
import {
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
Minimize2,
|
2026-02-17 13:24:33 -06:00
|
|
|
Maximize2,
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
Shield,
|
2026-02-17 13:24:33 -06:00
|
|
|
User,
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
} from "lucide-react";
|
|
|
|
|
import { cn } from "../lib/utils";
|
2026-02-17 20:07:30 -06:00
|
|
|
import { roleLabels } from "./agent-config-primitives";
|
|
|
|
|
import {
|
|
|
|
|
AgentConfigForm,
|
|
|
|
|
defaultCreateValues,
|
|
|
|
|
type CreateConfigValues,
|
|
|
|
|
} from "./AgentConfigForm";
|
2026-02-18 13:53:03 -06:00
|
|
|
import { getUIAdapter } from "../adapters";
|
2026-02-18 13:02:23 -06:00
|
|
|
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
export function NewAgentDialog() {
|
|
|
|
|
const { newAgentOpen, closeNewAgent } = useDialog();
|
|
|
|
|
const { selectedCompanyId, selectedCompany } = useCompany();
|
|
|
|
|
const queryClient = useQueryClient();
|
|
|
|
|
const navigate = useNavigate();
|
2026-02-17 13:24:33 -06:00
|
|
|
const [expanded, setExpanded] = useState(true);
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
|
|
|
|
|
// Identity
|
|
|
|
|
const [name, setName] = useState("");
|
|
|
|
|
const [title, setTitle] = useState("");
|
|
|
|
|
const [role, setRole] = useState("general");
|
|
|
|
|
const [reportsTo, setReportsTo] = useState("");
|
|
|
|
|
|
2026-02-17 20:07:30 -06:00
|
|
|
// Config values (managed by AgentConfigForm)
|
|
|
|
|
const [configValues, setConfigValues] = useState<CreateConfigValues>(defaultCreateValues);
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
|
|
|
|
|
// Popover states
|
|
|
|
|
const [roleOpen, setRoleOpen] = useState(false);
|
|
|
|
|
const [reportsToOpen, setReportsToOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
const { data: agents } = useQuery({
|
|
|
|
|
queryKey: queryKeys.agents.list(selectedCompanyId!),
|
|
|
|
|
queryFn: () => agentsApi.list(selectedCompanyId!),
|
|
|
|
|
enabled: !!selectedCompanyId && newAgentOpen,
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-17 13:24:33 -06:00
|
|
|
const { data: adapterModels } = useQuery({
|
2026-02-17 20:07:30 -06:00
|
|
|
queryKey: ["adapter-models", configValues.adapterType],
|
|
|
|
|
queryFn: () => agentsApi.adapterModels(configValues.adapterType),
|
2026-02-17 13:24:33 -06:00
|
|
|
enabled: newAgentOpen,
|
|
|
|
|
});
|
|
|
|
|
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
const isFirstAgent = !agents || agents.length === 0;
|
|
|
|
|
const effectiveRole = isFirstAgent ? "ceo" : role;
|
|
|
|
|
|
2026-02-17 13:24:33 -06:00
|
|
|
// Auto-fill for CEO
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (newAgentOpen && isFirstAgent) {
|
|
|
|
|
if (!name) setName("CEO");
|
|
|
|
|
if (!title) setTitle("CEO");
|
|
|
|
|
}
|
|
|
|
|
}, [newAgentOpen, isFirstAgent]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
|
|
|
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
const createAgent = useMutation({
|
|
|
|
|
mutationFn: (data: Record<string, unknown>) =>
|
|
|
|
|
agentsApi.create(selectedCompanyId!, data),
|
|
|
|
|
onSuccess: (agent) => {
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: queryKeys.agents.list(selectedCompanyId!) });
|
|
|
|
|
reset();
|
|
|
|
|
closeNewAgent();
|
|
|
|
|
navigate(`/agents/${agent.id}`);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function reset() {
|
|
|
|
|
setName("");
|
|
|
|
|
setTitle("");
|
|
|
|
|
setRole("general");
|
|
|
|
|
setReportsTo("");
|
2026-02-17 20:07:30 -06:00
|
|
|
setConfigValues(defaultCreateValues);
|
2026-02-17 13:24:33 -06:00
|
|
|
setExpanded(true);
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function buildAdapterConfig() {
|
2026-02-18 13:53:03 -06:00
|
|
|
const adapter = getUIAdapter(configValues.adapterType);
|
|
|
|
|
return adapter.buildAdapterConfig(configValues);
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleSubmit() {
|
|
|
|
|
if (!selectedCompanyId || !name.trim()) return;
|
|
|
|
|
createAgent.mutate({
|
|
|
|
|
name: name.trim(),
|
|
|
|
|
role: effectiveRole,
|
|
|
|
|
...(title.trim() ? { title: title.trim() } : {}),
|
|
|
|
|
...(reportsTo ? { reportsTo } : {}),
|
2026-02-17 20:07:30 -06:00
|
|
|
adapterType: configValues.adapterType,
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
adapterConfig: buildAdapterConfig(),
|
|
|
|
|
runtimeConfig: {
|
|
|
|
|
heartbeat: {
|
2026-02-17 20:07:30 -06:00
|
|
|
enabled: configValues.heartbeatEnabled,
|
|
|
|
|
intervalSec: configValues.intervalSec,
|
2026-02-17 13:24:33 -06:00
|
|
|
wakeOnAssignment: true,
|
|
|
|
|
wakeOnOnDemand: true,
|
|
|
|
|
wakeOnAutomation: true,
|
|
|
|
|
cooldownSec: 10,
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
},
|
|
|
|
|
},
|
2026-02-17 13:24:33 -06:00
|
|
|
contextMode: "thin",
|
|
|
|
|
budgetMonthlyCents: 0,
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleKeyDown(e: React.KeyboardEvent) {
|
|
|
|
|
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
handleSubmit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-17 13:24:33 -06:00
|
|
|
const currentReportsTo = (agents ?? []).find((a) => a.id === reportsTo);
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
|
|
|
|
open={newAgentOpen}
|
|
|
|
|
onOpenChange={(open) => {
|
2026-02-17 13:24:33 -06:00
|
|
|
if (!open) { reset(); closeNewAgent(); }
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<DialogContent
|
|
|
|
|
showCloseButton={false}
|
|
|
|
|
className={cn("p-0 gap-0 overflow-hidden", expanded ? "sm:max-w-2xl" : "sm:max-w-lg")}
|
|
|
|
|
onKeyDown={handleKeyDown}
|
|
|
|
|
>
|
|
|
|
|
{/* Header */}
|
|
|
|
|
<div className="flex items-center justify-between px-4 py-2.5 border-b border-border">
|
|
|
|
|
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
|
|
|
{selectedCompany && (
|
|
|
|
|
<span className="bg-muted px-1.5 py-0.5 rounded text-xs font-medium">
|
|
|
|
|
{selectedCompany.name.slice(0, 3).toUpperCase()}
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
<span className="text-muted-foreground/60">›</span>
|
|
|
|
|
<span>New agent</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-1">
|
2026-02-17 13:24:33 -06:00
|
|
|
<Button variant="ghost" size="icon-xs" className="text-muted-foreground" onClick={() => setExpanded(!expanded)}>
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
{expanded ? <Minimize2 className="h-3.5 w-3.5" /> : <Maximize2 className="h-3.5 w-3.5" />}
|
|
|
|
|
</Button>
|
2026-02-17 13:24:33 -06:00
|
|
|
<Button variant="ghost" size="icon-xs" className="text-muted-foreground" onClick={() => { reset(); closeNewAgent(); }}>
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
<span className="text-lg leading-none">×</span>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-17 13:24:33 -06:00
|
|
|
<div className="overflow-y-auto max-h-[70vh]">
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
{/* Name */}
|
|
|
|
|
<div className="px-4 pt-3">
|
|
|
|
|
<input
|
|
|
|
|
className="w-full text-base font-medium bg-transparent outline-none placeholder:text-muted-foreground/50"
|
|
|
|
|
placeholder="Agent name"
|
|
|
|
|
value={name}
|
|
|
|
|
onChange={(e) => setName(e.target.value)}
|
|
|
|
|
autoFocus
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Title */}
|
|
|
|
|
<div className="px-4 pb-2">
|
|
|
|
|
<input
|
|
|
|
|
className="w-full bg-transparent outline-none text-sm text-muted-foreground placeholder:text-muted-foreground/40"
|
|
|
|
|
placeholder="Title (e.g. VP of Engineering)"
|
|
|
|
|
value={title}
|
|
|
|
|
onChange={(e) => setTitle(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-17 13:24:33 -06:00
|
|
|
{/* Property chips: Role + Reports To */}
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
<div className="flex items-center gap-1.5 px-4 py-2 border-t border-border flex-wrap">
|
|
|
|
|
{/* Role */}
|
|
|
|
|
<Popover open={roleOpen} onOpenChange={setRoleOpen}>
|
|
|
|
|
<PopoverTrigger asChild>
|
|
|
|
|
<button
|
|
|
|
|
className={cn(
|
|
|
|
|
"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-accent/50 transition-colors",
|
|
|
|
|
isFirstAgent && "opacity-60 cursor-not-allowed"
|
|
|
|
|
)}
|
|
|
|
|
disabled={isFirstAgent}
|
|
|
|
|
>
|
|
|
|
|
<Shield className="h-3 w-3 text-muted-foreground" />
|
|
|
|
|
{roleLabels[effectiveRole] ?? effectiveRole}
|
|
|
|
|
</button>
|
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
<PopoverContent className="w-36 p-1" align="start">
|
|
|
|
|
{AGENT_ROLES.map((r) => (
|
|
|
|
|
<button
|
|
|
|
|
key={r}
|
|
|
|
|
className={cn(
|
|
|
|
|
"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-accent/50",
|
|
|
|
|
r === role && "bg-accent"
|
|
|
|
|
)}
|
|
|
|
|
onClick={() => { setRole(r); setRoleOpen(false); }}
|
|
|
|
|
>
|
|
|
|
|
{roleLabels[r] ?? r}
|
|
|
|
|
</button>
|
|
|
|
|
))}
|
|
|
|
|
</PopoverContent>
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
{/* Reports To */}
|
|
|
|
|
<Popover open={reportsToOpen} onOpenChange={setReportsToOpen}>
|
|
|
|
|
<PopoverTrigger asChild>
|
|
|
|
|
<button
|
|
|
|
|
className={cn(
|
|
|
|
|
"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-accent/50 transition-colors",
|
|
|
|
|
isFirstAgent && "opacity-60 cursor-not-allowed"
|
|
|
|
|
)}
|
|
|
|
|
disabled={isFirstAgent}
|
|
|
|
|
>
|
|
|
|
|
<User className="h-3 w-3 text-muted-foreground" />
|
2026-02-17 13:24:33 -06:00
|
|
|
{currentReportsTo
|
|
|
|
|
? `Reports to ${currentReportsTo.name}`
|
|
|
|
|
: isFirstAgent
|
|
|
|
|
? "Reports to: N/A (CEO)"
|
|
|
|
|
: "Reports to..."
|
|
|
|
|
}
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
</button>
|
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
<PopoverContent className="w-48 p-1" align="start">
|
|
|
|
|
<button
|
|
|
|
|
className={cn(
|
|
|
|
|
"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-accent/50",
|
|
|
|
|
!reportsTo && "bg-accent"
|
|
|
|
|
)}
|
|
|
|
|
onClick={() => { setReportsTo(""); setReportsToOpen(false); }}
|
|
|
|
|
>
|
|
|
|
|
No manager
|
|
|
|
|
</button>
|
|
|
|
|
{(agents ?? []).map((a) => (
|
|
|
|
|
<button
|
|
|
|
|
key={a.id}
|
|
|
|
|
className={cn(
|
|
|
|
|
"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-accent/50 truncate",
|
|
|
|
|
a.id === reportsTo && "bg-accent"
|
|
|
|
|
)}
|
|
|
|
|
onClick={() => { setReportsTo(a.id); setReportsToOpen(false); }}
|
|
|
|
|
>
|
|
|
|
|
{a.name}
|
|
|
|
|
<span className="text-muted-foreground ml-auto">{roleLabels[a.role] ?? a.role}</span>
|
|
|
|
|
</button>
|
|
|
|
|
))}
|
|
|
|
|
</PopoverContent>
|
|
|
|
|
</Popover>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-17 20:07:30 -06:00
|
|
|
{/* Shared config form (adapter + heartbeat) */}
|
|
|
|
|
<AgentConfigForm
|
|
|
|
|
mode="create"
|
|
|
|
|
values={configValues}
|
|
|
|
|
onChange={(patch) => setConfigValues((prev) => ({ ...prev, ...patch }))}
|
|
|
|
|
adapterModels={adapterModels}
|
|
|
|
|
/>
|
Build out agent management UI: detail page, create dialog, list view
Add NewAgentDialog for creating agents with adapter config. Expand
AgentDetail page with tabbed view (overview, runs, config, logs),
run history timeline, and live status. Enhance Agents list page with
richer cards and filtering. Update AgentProperties panel, API client,
query keys, and utility helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:33:04 -06:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Footer */}
|
|
|
|
|
<div className="flex items-center justify-between px-4 py-2.5 border-t border-border">
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{isFirstAgent ? "This will be the CEO" : ""}
|
|
|
|
|
</span>
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
disabled={!name.trim() || createAgent.isPending}
|
|
|
|
|
onClick={handleSubmit}
|
|
|
|
|
>
|
|
|
|
|
{createAgent.isPending ? "Creating..." : "Create agent"}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|