/** * herdctl agent commands * * Commands for managing installed agents: * - herdctl agent add Install an agent from GitHub or local path * - herdctl agent list List all discovered agents in the fleet * - herdctl agent info Show detailed information about an agent * - herdctl agent remove Remove an installed agent * * The add command orchestrates the full agent installation flow: * 1. Parse source specifier (github:user/repo[@ref] or ./local/path) * 2. Fetch repository to temp directory * 3. Validate agent repository structure * 4. Install files to ./agents// * 5. Update herdctl.yaml with agent reference * 6. Scan and display required environment variables */ import { type ResolvedAgent } from "@herdctl/core"; export interface AgentAddOptions { /** Override the target installation directory */ path?: string; /** Show what would happen without making changes */ dryRun?: boolean; /** Overwrite existing agent directory */ force?: boolean; /** Path to config file or directory */ config?: string; } export interface AgentRemoveOptions { /** Skip confirmation (no-op for now, reserved for future interactive confirmation) */ force?: boolean; /** Preserve workspace directory contents */ keepWorkspace?: boolean; /** Path to config file or directory */ config?: string; } /** * Install an agent from a source specifier * * Orchestrates the full installation flow: * 1. Parse source specifier * 2. Fetch repository * 3. Validate repository * 4. Install files (unless dry-run) * 5. Update fleet config (unless dry-run) * 6. Scan and display env variables * 7. Cleanup temp directory * * @param source - Source specifier (e.g., "github:user/repo", "./local/path") * @param options - Command options */ export declare function agentAddCommand(source: string, options: AgentAddOptions): Promise; export interface AgentListOptions { /** Output as JSON for scripting */ json?: boolean; /** Path to config file or directory */ config?: string; } /** * Maximum number of agents before switching to summary mode. * When total agents exceed this threshold, fleet-level counts are shown * instead of individual agent names to avoid overwhelming output. */ export declare const TREE_AGENT_THRESHOLD = 200; /** * Tree node representing a fleet or agent in the hierarchy */ export interface FleetTreeNode { name: string; description?: string; agents: string[]; children: FleetTreeNode[]; } /** * Build a tree structure from a flat array of resolved agents. * * Groups agents by their fleetPath hierarchy. Root-level agents (empty fleetPath) * go directly under the root node. Sub-fleet agents are nested under their * respective fleet nodes. */ export declare function buildFleetTree(agents: ResolvedAgent[], rootName: string, rootDescription?: string): FleetTreeNode; /** * Render a fleet tree with box-drawing characters. * * Uses standard Unicode box-drawing characters for the tree structure: * - Connector for intermediate items * - End connector for last items * - Vertical bar for continuing branches * * @param node - The tree node to render * @param prefix - Current indentation prefix * @param isLast - Whether this node is the last child of its parent * @param isRoot - Whether this is the root node * @param summaryMode - When true, show agent counts instead of names */ export declare function renderFleetTree(node: FleetTreeNode, prefix?: string, isLast?: boolean, isRoot?: boolean, summaryMode?: boolean): string[]; /** * List all agents in the fleet * * Discovers agents from the fleet configuration and displays them. * When sub-fleets exist, displays a tree view showing agents grouped by fleet hierarchy. * When no sub-fleets exist, displays a flat table (original behavior). * * If total agents across the hierarchy exceed 200, shows fleet-level summary counts * instead of individual agent names. * * @param options - Command options */ export declare function agentListCommand(options: AgentListOptions): Promise; export interface AgentInfoOptions { /** Output as JSON for scripting */ json?: boolean; /** Path to config file or directory */ config?: string; } /** * Get detailed information about a specific agent * * Shows comprehensive agent information including: * - Basic info (name, description, status) * - Source and installation details * - Environment variables * - Schedules * - Files in the agent directory * * @param name - Agent name to look up * @param options - Command options */ export declare function agentInfoCommand(name: string, options: AgentInfoOptions): Promise; /** * Remove an agent from the fleet * * This command: * 1. Finds the agent by name in the fleet configuration * 2. Deletes the agent directory (optionally preserving workspace) * 3. Removes the agent reference from herdctl.yaml * 4. Reports environment variables that were used (for cleanup reference) * * @param name - Agent name to remove * @param options - Command options */ export declare function agentRemoveCommand(name: string, options: AgentRemoveOptions): Promise; //# sourceMappingURL=agent.d.ts.map