import type { BackendType } from '../adapters/backend/types.js'; import type { RiffBackendConfig } from '../adapters/backend/riff-backend.js'; import { cancelRiffTaskById } from '../adapters/backend/riff-backend.js'; import { killPersistentSession, probePersistentSession } from './persistent-backend.js'; export type ExplicitSessionBackingCleanupResult = { ok: true; kind: 'skipped_adopted' | 'no_backing'; } | { ok: true; kind: 'destroyed_persistent'; backendType: 'tmux' | 'herdr' | 'zellij' | 'zmx'; name: string; } | { ok: true; kind: 'cancelled_riff'; taskId: string; } | { ok: false; kind: 'persistent_destroy_failed' | 'riff_config_missing' | 'riff_cancel_failed'; backendType: BackendType; taskId?: string; error?: string; }; export interface ExplicitSessionBackingCleanupInput { sessionId: string; backendType?: BackendType; riffParentTaskId?: string; /** Adopted panes/agents are user-owned. Explicit Botmux close only detaches * its logical row and must never destroy the observed backing resource. */ adopted?: boolean; /** Current authoritative config for the row's bot. Required only when the * row is frozen to Riff and still carries a remote task id. */ riffConfig?: RiffBackendConfig; } export interface ExplicitSessionBackingCleanupDeps { cancelRiffTask?: typeof cancelRiffTaskById; killPersistent?: typeof killPersistentSession; probePersistent?: typeof probePersistentSession; } /** * Destroy the Botmux-owned backing resource before an offline/worker-less * explicit close is published. * * This helper never mutates the session record. In particular, callers may * erase `riffParentTaskId` only after `kind === 'cancelled_riff'`; a failed or * unconfigurable cancellation therefore retains the durable retry handle. */ export declare function cleanupExplicitSessionBacking(input: ExplicitSessionBackingCleanupInput, deps?: ExplicitSessionBackingCleanupDeps): Promise; //# sourceMappingURL=explicit-session-backing-cleanup.d.ts.map