/**
 * Detached task runner. The hidden `_task-runner <runId>` subcommand of the
 * `franklin` CLI dispatches into this module, which is what actually executes
 * the user's command in the detached child process.
 *
 * Lifecycle (per task):
 *   1. Read meta.json. Bail with exit code 2 if it's gone.
 *   2. Open log.txt for append, record our own pid + status=running, emit
 *      a `running` event.
 *   3. Spawn `bash -lc <command>` with stdout/stderr piped to log.txt.
 *   4. Heartbeat every 5s: just refresh meta.lastEventAt so observers can see
 *      "still going."
 *   5. On child exit (or spawn error), close the log fd, finalize meta with
 *      exitCode + status (`succeeded` if 0, `failed` otherwise), emit a
 *      terminal event whose summary is the last 500 chars of log.
 *
 * Defensive style: we re-read meta inside the heartbeat and on exit because
 * a concurrent `franklin task cancel` (or external `rm -rf`) can vanish the
 * task dir mid-flight. Every fs operation is best-effort.
 */
export declare function runDetachedTask(runId: string): Promise<number>;
