"use client"; import { useState, useMemo } from "react"; import { useRouter } from "next/navigation"; import { IconPlus, IconTrash } from "@tabler/icons-react"; import { Badge } from "@kandev/ui/badge"; import { Button } from "@kandev/ui/button"; import { Card, CardContent } from "@kandev/ui/card"; import { Separator } from "@kandev/ui/separator"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@kandev/ui/dialog"; import { useAppStore } from "@/components/state-provider"; import { deleteExecutorProfile } from "@/lib/api/domains/settings-api"; import { EXECUTOR_ICON_MAP, getExecutorLabel } from "@/lib/executor-icons"; import type { Executor, ExecutorProfile } from "@/lib/types/http"; type ProfileWithExecutor = ExecutorProfile & { executor_type: string; executor_name: string; parent_executor_id: string; }; function useAllProfiles(): ProfileWithExecutor[] { const executors = useAppStore((state) => state.executors.items); return useMemo( () => executors.flatMap((e: Executor) => (e.profiles ?? []).map((p) => ({ ...p, executor_type: e.type, executor_name: e.name, parent_executor_id: e.id, })), ), [executors], ); } const DefaultIcon = EXECUTOR_ICON_MAP.local; const EXECUTOR_TYPES = [ { type: "local", label: "Local", description: "Run agents directly in the repository folder." }, { type: "worktree", label: "Worktree", description: "Create git worktrees for isolated agent sessions.", }, { type: "local_docker", label: "Docker", description: "Run Docker containers on this machine." }, { type: "sprites", label: "Sprites.dev", description: "Run agents in Sprites.dev cloud sandboxes.", }, { type: "ssh", label: "SSH", description: "Connect to a remote host over SSH and run agentctl there.", }, ] as const; function ExecutorIconBadge({ type }: { type: string }) { const Icon = EXECUTOR_ICON_MAP[type] ?? DefaultIcon; return (
{profile.name}
{execType.label}
{execType.description}
Executor profiles define how and where agents run. Each profile configures an execution environment with scripts, environment variables, and MCP policies.