2026-03-07 08:26:49 -06:00
|
|
|
import { useQuery } from "@tanstack/react-query";
|
2026-03-02 16:44:03 -06:00
|
|
|
import { useNavigate } from "@/lib/router";
|
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 { useDialog } from "../context/DialogContext";
|
|
|
|
|
import { useCompany } from "../context/CompanyContext";
|
|
|
|
|
import { agentsApi } from "../api/agents";
|
|
|
|
|
import { queryKeys } from "../lib/queryKeys";
|
|
|
|
|
import {
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogContent,
|
|
|
|
|
} from "@/components/ui/dialog";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
2026-03-07 08:26:49 -06:00
|
|
|
import { Bot, Sparkles } from "lucide-react";
|
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() {
|
2026-03-07 08:26:49 -06:00
|
|
|
const { newAgentOpen, closeNewAgent, openNewIssue } = useDialog();
|
|
|
|
|
const { selectedCompanyId } = useCompany();
|
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 navigate = useNavigate();
|
|
|
|
|
|
|
|
|
|
const { data: agents } = useQuery({
|
|
|
|
|
queryKey: queryKeys.agents.list(selectedCompanyId!),
|
|
|
|
|
queryFn: () => agentsApi.list(selectedCompanyId!),
|
|
|
|
|
enabled: !!selectedCompanyId && newAgentOpen,
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-07 08:26:49 -06:00
|
|
|
const ceoAgent = (agents ?? []).find((a) => a.role === "ceo");
|
2026-02-17 13:24:33 -06:00
|
|
|
|
2026-03-07 08:26:49 -06:00
|
|
|
function handleAskCeo() {
|
|
|
|
|
closeNewAgent();
|
|
|
|
|
openNewIssue({
|
|
|
|
|
assigneeAgentId: ceoAgent?.id,
|
|
|
|
|
title: "Create a new agent",
|
|
|
|
|
description: "(type in what kind of agent you want here)",
|
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-03-07 08:26:49 -06:00
|
|
|
function handleAdvancedConfig() {
|
|
|
|
|
closeNewAgent();
|
|
|
|
|
navigate("/agents/new");
|
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-03-07 08:26:49 -06:00
|
|
|
if (!open) 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}
|
2026-03-07 08:26:49 -06:00
|
|
|
className="sm:max-w-md p-0 gap-0 overflow-hidden"
|
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
|
|
|
>
|
|
|
|
|
{/* Header */}
|
|
|
|
|
<div className="flex items-center justify-between px-4 py-2.5 border-b border-border">
|
2026-03-07 08:26:49 -06:00
|
|
|
<span className="text-sm text-muted-foreground">Add a new agent</span>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon-xs"
|
|
|
|
|
className="text-muted-foreground"
|
|
|
|
|
onClick={closeNewAgent}
|
|
|
|
|
>
|
|
|
|
|
<span className="text-lg leading-none">×</span>
|
|
|
|
|
</Button>
|
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>
|
|
|
|
|
|
2026-03-07 08:26:49 -06:00
|
|
|
<div className="p-6 space-y-6">
|
|
|
|
|
{/* Recommendation */}
|
|
|
|
|
<div className="text-center space-y-3">
|
|
|
|
|
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-accent">
|
|
|
|
|
<Sparkles className="h-6 w-6 text-foreground" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
We recommend letting your CEO handle agent setup — they know the
|
|
|
|
|
org structure and can configure reporting, permissions, and
|
|
|
|
|
adapters.
|
|
|
|
|
</p>
|
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>
|
|
|
|
|
|
2026-03-07 08:26:49 -06:00
|
|
|
<Button className="w-full" size="lg" onClick={handleAskCeo}>
|
|
|
|
|
<Bot className="h-4 w-4 mr-2" />
|
|
|
|
|
Ask the CEO to create a new agent
|
|
|
|
|
</Button>
|
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-03-07 08:26:49 -06:00
|
|
|
{/* Advanced link */}
|
|
|
|
|
<div className="text-center">
|
|
|
|
|
<button
|
|
|
|
|
className="text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors"
|
|
|
|
|
onClick={handleAdvancedConfig}
|
|
|
|
|
>
|
|
|
|
|
I want advanced configuration myself
|
|
|
|
|
</button>
|
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>
|
|
|
|
|
</div>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|