import { LocalConfig } from './guild-config.js';
import { GuildAPIClient } from './api-client.js';
import type { AgentVersion } from './api-types.js';
/** Thrown when the ephemeral version build times out or polling fails. */
export declare class BuildTimeoutError extends Error {
    constructor(message?: string);
}
/** Thrown when the ephemeral version build fails validation. */
export declare class BuildFailedError extends Error {
    readonly failedSteps: {
        name: string;
        content?: string;
    }[];
    constructor(failedSteps: {
        name: string;
        content?: string;
    }[]);
}
/**
 * Resolve an agent identifier to a fully-qualified form.
 *
 * If the identifier already contains `~` or is a UUID, return it verbatim.
 * Otherwise, resolve the default owner and prepend `owner.name~`.
 */
export declare function resolveAgentRef(client: GuildAPIClient, identifier: string): Promise<string>;
/**
 * Get agent ID from argument or guild.json in current directory
 * @param agentIdArg - Optional agent ID from command argument
 * @param cwd - Current working directory (defaults to process.cwd())
 * @returns Agent ID and config (if from guild.json)
 * @throws Error if neither argument nor guild.json provides an agent ID
 */
export declare function getAgentId(agentIdArg?: string, cwd?: string): Promise<{
    agentId: string;
    config?: LocalConfig;
}>;
/**
 * Read agent files from disk for ephemeral version creation.
 * Uses git ls-files to respect .gitignore.
 * @returns Array of {path, content} objects
 */
export declare function readAgentFiles(cwd: string): Promise<{
    path: string;
    content: string;
}[]>;
/**
 * Compute a deterministic hash of agent files.
 * Sorts by path to ensure consistent ordering.
 */
export declare function hashAgentFiles(files: {
    path: string;
    content: string;
}[]): string;
/**
 * Get or create an ephemeral version, skipping the build if files haven't
 * changed since the last successful ephemeral build.
 *
 * Returns the version (cached or newly created), a cache hit flag, and the
 * computed hash (used by buildEphemeralVersion to write the cache on success).
 */
export declare function getOrCreateEphemeral(client: GuildAPIClient, agentId: string, files: {
    path: string;
    content: string;
}[], cwd: string, summary: string, options?: {
    noCache?: boolean;
}): Promise<{
    version: AgentVersion;
    cached: boolean;
    hash: string;
}>;
/**
 * Build an ephemeral version end-to-end: get-or-create, poll for validation,
 * cache on success, and report build failures.
 *
 * Consolidates the build/poll/cache pattern used by both `guild agent test`
 * and `guild agent chat`.
 */
export declare function buildEphemeralVersion(client: GuildAPIClient, agentId: string, files: {
    path: string;
    content: string;
}[], cwd: string, summary: string, options?: {
    noCache?: boolean;
}): Promise<{
    version: AgentVersion;
    cached: boolean;
}>;
/** Thrown when the specified bundle file cannot be found on disk. */
export declare class BundleNotFoundError extends Error {
    constructor(filePath: string);
}
/**
 * Upload a pre-built bundle as an ephemeral version.
 *
 * The bundle file must be gzip+base64 encoded (the output of
 * `esbuild ... | gzip | base64`). Source files are included for
 * dashboard viewing, but the server skips its own build step because
 * the ready-to-run artifact is already provided.
 */
export declare function buildBundledVersion(client: GuildAPIClient, agentId: string, bundlePath: string, cwd: string, summary: string): Promise<{
    version: AgentVersion;
}>;
//# sourceMappingURL=agent-helpers.d.ts.map