/**
 * GatewaySessionsApi — session CRUD, search, compaction, tag/pin/archive,
 * stats, and chat-id grouping for the gateway REST surface.
 *
 * Twenty-four methods, previously sitting on `GatewayService` as a mix of
 * one-line `sessionIndex.*` delegations and small composite operations (e.g.
 * `restoreCheckpoint` also evicts the in-memory agent, `runCompaction` also
 * appends a transcript context entry). Centralising them here lets routes
 * depend on the narrow `GatewaySessionsApi` surface instead of the full
 * `GatewayService`, and keeps the gateway composition root focused on
 * lifecycle + wiring.
 */
import type { AgentService } from '../../agent/service.js';
import type { CompactionResult } from '../../agent/memory/compaction.js';
import { SessionIndex } from '../../session/index.js';
import type { ExportFormat, SessionListQuery } from '../../session/types.js';
import type { SessionPatchBody } from '../../session/patch-metadata.js';
import { type SessionResetResult } from '../session-reset-service.js';
export interface GatewaySessionsApiOptions {
    sessionIndex: SessionIndex;
    /** Resolves the live agent service (created lazily; throws if gateway is starting). */
    getAgentService: () => AgentService;
    /** Read-only view of in-flight webchat runs (per session key → run id). */
    getActiveWebchatRunId: (sessionKey: string) => string | undefined;
}
export declare class GatewaySessionsApi {
    private readonly opts;
    constructor(opts: GatewaySessionsApiOptions);
    listSessions(query?: SessionListQuery): Promise<import("../../session/types.js").PaginatedResult<import("../../session/types.js").SessionMetadata>>;
    /** Subagent sessions have keys starting with `subagent:`. */
    listSubagents(query?: SessionListQuery): Promise<import("../../session/types.js").PaginatedResult<import("../../session/types.js").SessionMetadata>>;
    getSession(key: string, options?: {
        includeTranscriptSummary?: boolean;
        includeTranscriptRows?: boolean;
    }): Promise<import("../../session/types.js").SessionDetail>;
    /** Read-only: in-flight webchat agent run for this session key, if any. */
    getActiveRun(sessionKey: string): {
        active: boolean;
        runId?: string;
    };
    getMessagePage(key: string, options?: {
        offset?: number;
        limit?: number;
        before?: string;
        includeTranscriptSummary?: boolean;
        includeTranscriptRows?: boolean;
    }): Promise<{
        session: import("../../session/types.js").SessionDetail;
        pagination: {
            total: number;
            limit: number;
            offset: number;
            hasMore: boolean;
            before?: string;
            nextBeforeCursor?: string;
        };
    }>;
    patch(key: string, body: SessionPatchBody): Promise<{
        ok: true;
    } | {
        ok: false;
        error: string;
    }>;
    getAgentConfig(sessionKey: string): Promise<import("../../agent/session/session-inspector.js").SessionAgentConfigView>;
    /** Resolved markdown workspace for a session (after hydration / mkdir). */
    getEffectiveWorkspacePath(sessionKey: string): Promise<string>;
    patchAgentConfig(sessionKey: string, body: {
        thinkingLevel?: string;
        model?: string | null;
        reasoningLevel?: string;
        workingDirectory?: string;
    }): Promise<import("../../agent/session/session-config-service.js").PatchSessionAgentConfigResult>;
    listCompactionCheckpoints(key: string): Promise<import("../../session/types.js").CompactionCheckpointSummary[]>;
    getCompactionCheckpoint(key: string, checkpointId: string): Promise<import("../../session/types.js").CompactionCheckpointDetail>;
    restoreCompactionCheckpoint(key: string, checkpointId: string): Promise<void>;
    runCompaction(key: string, options?: {
        instructions?: string;
        force?: boolean;
    }): Promise<CompactionResult>;
    delete(key: string): Promise<{
        deleted: boolean;
    }>;
    /** Reset transcript in place (archive + new session id); preserves session key and overrides. */
    reset(key: string): Promise<SessionResetResult>;
    deleteMany(keys: string[]): Promise<{
        success: string[];
        failed: string[];
    }>;
    rename(key: string, name: string): Promise<{
        renamed: boolean;
    }>;
    tag(key: string, tags: string[]): Promise<{
        tagged: boolean;
    }>;
    untag(key: string, tags: string[]): Promise<{
        untagged: boolean;
    }>;
    archive(key: string): Promise<{
        archived: boolean;
    }>;
    unarchive(key: string): Promise<{
        unarchived: boolean;
    }>;
    pin(key: string): Promise<{
        pinned: boolean;
    }>;
    unpin(key: string): Promise<{
        unpinned: boolean;
    }>;
    search(query: string): Promise<import("../../session/types.js").SessionMetadata[]>;
    searchIn(key: string, keyword: string): Promise<import("../../session/types.js").Message[]>;
    export(key: string, format: ExportFormat): Promise<{
        content: string;
    }>;
    stats(): Promise<import("../../session/types.js").GlobalSessionStats>;
    /**
     * Distinct chat-id pairs from sessions, grouped by channel. Used by cron job
     * configuration UI to seed the "send to existing chat" picker.
     */
    chatIds(channel?: string): Promise<Array<{
        channel: string;
        chatId: string;
        lastActive: string;
        accountId?: string;
        peerKind?: string;
        peerId?: string;
    }>>;
}
