/**
 * Shared host-run dispatch — the one path every surface uses to run an agent on
 * another machine: `agents run --device` (commands/exec.ts), the `host` cloud
 * provider (`agents cloud run --provider host`), and host-placed routines.
 *
 * Wraps the two steps every caller needs and previously lived inline in
 * exec.ts's `--device` branch:
 *   1. resolution — name → capability tag → error, with the same fall-through
 *      semantics as `agents run --device` (only "Multiple hosts tagged…" is a
 *      resolution verdict; "no host tagged" degrades to unknown-host), and
 *   2. headless dispatch — session-id mint (Claude only), detached SSH launch,
 *      and LOCAL session-index registration so the run shows in `agents sessions`.
 *
 * Interactive dispatch stays in exec.ts: it is inherently tied to the caller's
 * TTY and has no other consumers.
 */
import type { Host } from './types.js';
import type { DispatchResult } from './dispatch.js';
import type { HostCredentials } from './credentials.js';
/**
 * Resolution failed with a user-actionable message the caller should print
 * verbatim. Distinct from `DeviceOffloadUnsupportedError` (which propagates to
 * the top-level catch) so callers can tell "bad name" from "bad auth method".
 */
export declare class HostResolutionError extends Error {
    constructor(message: string);
}
/**
 * Resolve a `--device` value the way `agents run` does: exact name (providers →
 * devices → `user@host`), then capability tag. Throws `HostResolutionError`
 * for an ambiguous tag or an unknown name; lets `DeviceOffloadUnsupportedError`
 * (password-auth device) propagate untouched for the top-level catch.
 */
export declare function resolveHostRunTarget(name: string, opts?: {
    any?: boolean;
}): Promise<Host>;
export interface HostPromptRun {
    agent: string;
    prompt: string;
    /** Explicit agent version pin, forwarded as `agent@version`. */
    version?: string;
    mode?: string;
    model?: string;
    /** Durable `--name <slug>` handle recorded on the task. */
    name?: string;
    /** Resume an existing session on the host by concrete id. */
    resume?: string;
    /** Explicit id for a new Claude session. */
    sessionId?: string;
    /** Working directory on the host, already made remote-portable by the caller. */
    remoteCwd?: string;
    /** `remoteCwd` was derived from the local cwd — mirror it, don't fail on it. */
    mirrorCwd?: boolean;
    /** Stream progress and block until completion (default true). */
    follow?: boolean;
    timeoutMs?: number;
    /** Local directory to record in the session index (defaults to process.cwd()). */
    cwd?: string;
    /** Forwarded run options — see RUN_OPTION_FORWARDING in remote-cmd.ts. */
    effort?: string;
    env?: string[];
    addDir?: string[];
    timeout?: string;
    strategy?: string;
    account?: string;
    balanced?: boolean;
    fallback?: string;
    loop?: boolean;
    maxIterations?: string;
    budget?: string;
    until?: string;
    interval?: string;
    json?: boolean;
    verbose?: boolean;
    yes?: boolean;
    acp?: boolean;
    autoSecrets?: boolean;
    passthroughArgs?: string[];
    /** Copy runtime credentials to the host before the run and shred them after. */
    copyCreds?: HostCredentials;
}
/** Resolve the id the remote host will adopt for a fresh Claude session. */
export declare function resolveHostSessionId(agent: string, resume?: string, sessionId?: string): string | undefined;
/**
 * Dispatch a headless prompt run onto a resolved host, then relate the run's
 * session id back to this launcher for EVERY agent — not just Claude.
 *
 * Claude is the only agent that accepts a forced `--session-id`, so we mint one
 * up front and know it immediately. For every other agent the remote run coins
 * its OWN id; we forward `--emit-session-id` so the remote prints that id as a
 * stdout sentinel (hosts/session-marker.ts), and once the follow returns we parse
 * it out of the mirrored local log and stamp it on the task before registering —
 * so `agents sessions`/resume-by-id can map the discovered session home. On
 * resume the remote session keeps its existing id (passed through, no capture).
 *
 * Returns the task record and the remote exit code (`-1` = follow window closed
 * while the run continues).
 */
export declare function dispatchPromptToHost(host: Host, opts: HostPromptRun): Promise<DispatchResult>;
