/** * Agent install pipeline — business logic extracted from `cleo agent install`. * * Handles three input shapes (.cant file, .cantz archive, agent directory) and * delegates to the `installAgentFromCant` core function. The CLI handler calls * {@link resolveAgentCantPath} to normalize inputs, then passes the resolved * `.cant` path to the core installation function directly. * * @module agents/install-pipeline * @epic T9833 * @task T10062 */ /** Three input shapes accepted by the install command. */ export type AgentInstallInputKind = 'cant-file' | 'cantz-archive' | 'agent-directory'; /** Result of {@link resolveAgentCantPath}. */ export interface ResolvedCantPath { /** Absolute path to the canonical `.cant` file ready for the pipeline. */ cantPath: string; /** Input shape that was resolved. */ kind: AgentInstallInputKind; /** * Temp directory created during extraction (only set for `cantz-archive` * and `agent-directory` shapes). The caller is responsible for cleanup. */ tempDir: string | null; } /** Options for {@link resolveAgentCantPath}. */ export interface ResolveAgentCantPathOptions { /** Absolute path to the input file or directory. */ resolvedPath: string; } /** * Normalize a user-supplied path into a canonical `.cant` file path. * * Three shapes are handled: * 1. `.cant` — used as-is. * 2. `.cantz` — extracted to a temp dir; `persona.cant` renamed to * `.cant`. * 3. `/persona.cant` — copied from directory into a temp dir. * * @param opts - Resolution options * @returns The resolved `.cant` path and cleanup metadata * @throws {Error} When the path is not a valid input shape */ export declare function resolveAgentCantPath(opts: ResolveAgentCantPathOptions): ResolvedCantPath; /** * Remove a temp directory created during install resolution. * * Best-effort — never throws. Should be called in a `finally` block after the * installation completes or fails. * * @param tempDir - Directory to remove (null is a no-op) */ export declare function cleanupInstallTempDir(tempDir: string | null): void; //# sourceMappingURL=install-pipeline.d.ts.map