/**
 * Register cloud-dispatched tasks into the LOCAL session index, keyed by the
 * real execution id, so a launch is mappable to a session immediately.
 *
 * The cloud store (`tasks.db`) and the session index (`sessions` table) were two
 * disjoint stores: a `agents cloud run` wrote only the store, and the session
 * index learned about the run only later, via `discoverCloudSessions` hitting the
 * proxy. Until that discovery ran there was no launch→session mapping at all —
 * the run was orphaned in `agents sessions` exactly like the non-Claude host runs.
 *
 * This mirrors hosts/session-index.ts: the transcript is remote (fetched on
 * demand by session/cloud.ts), so the row is registered with an EMPTY `file_path`
 * — the sentinel db.js's stale-row filter treats as "always live" — and a
 * `[cloud/<status>]` label. The row is written at dispatch and refreshed on every
 * status poll so the label tracks the task's lifecycle. Non-session-agent cloud
 * providers (a task whose agent has no transcript format) are skipped: there is
 * nothing to resolve or resume by id.
 */
import type { CloudTask } from './types.js';
/** Context a cloud task needs to become a session row — the LOCAL dir it was launched from. */
export interface CloudSessionContext {
    /** Local directory `agents cloud run` was invoked from. Defaults to process.cwd(). */
    cwd?: string;
}
/**
 * Register (or refresh) a cloud task in the local session index. No-op when the
 * task's agent isn't a known session agent, or its id isn't a usable execution id
 * (never a fabricated `codex-<ts>` — codex.ts fails loud instead of minting one,
 * but guard here too so a bad id can never seed a bogus row). Best-effort: a
 * failed index write must never break the dispatch/poll it rides on.
 */
export declare function registerCloudSession(task: CloudTask, ctx?: CloudSessionContext): void;
