import type { SDKSessionInfo, SessionMessage, ListSessionsOptions, GetSessionInfoOptions, GetSessionMessagesOptions, GetSubagentMessagesOptions, ListSubagentsOptions, SessionMutationOptions } from '../types/session.js'; /** * List sessions with metadata. * * Returns sessions sorted by last-modified time (most recent first). * Supports filtering by directory and pagination via offset/limit. * * @param options.dir - Only list sessions from this working directory * @param options.limit - Maximum number of sessions to return * @param options.offset - Number of sessions to skip (for pagination) * @param options.includeWorktrees - Include git worktree sessions (default: true) * * @example * ```ts * // List the 10 most recent sessions * const sessions = await listSessions({ limit: 10 }); * * // List sessions from a specific project * const projectSessions = await listSessions({ dir: '/path/to/project' }); * ``` */ export declare function listSessions(options?: ListSessionsOptions): Promise; /** * Get info for a single session by ID. * * Searches the configured project directories for a JSONL file matching * the session ID and returns its parsed metadata. * * @param sessionId - The session UUID to look up * @param options.dir - Restrict search to this working directory * @returns Session info, or undefined if not found */ export declare function getSessionInfo(sessionId: string, options?: GetSessionInfoOptions): Promise; /** * Get messages from a session transcript. * * Parses the JSONL transcript, follows the session's persisted active leaf * (falling back to the latest main leaf for legacy transcripts), and returns * visible user/assistant messages in chronological order. Supports pagination * via offset/limit. Set `includeSystemMessages` to include chain system entries * such as compact boundaries. * * @param sessionId - The session UUID * @param options.dir - Restrict search to this working directory * @param options.limit - Maximum number of messages to return * @param options.offset - Number of messages to skip * @returns Array of session messages, or an empty array if the session is absent */ export declare function getSessionMessages(sessionId: string, options?: GetSessionMessagesOptions): Promise; /** * Rename a session by appending a custom-title entry to its JSONL file. * * The custom title overrides the default first-prompt summary when * listing sessions. * * @param sessionId - The session UUID to rename * @param title - The new display title * @param options.dir - Restrict search to this working directory * @throws Error if the session is not found */ export declare function renameSession(sessionId: string, title: string, options?: SessionMutationOptions): Promise; /** * Tag a session by appending a tag entry to its JSONL file. * * Tags can be used to categorize or filter sessions. Pass `null` to * remove the tag. * * @param sessionId - The session UUID to tag * @param tag - The tag string, or `null` to remove the tag * @param options.dir - Restrict search to this working directory * @throws Error if the session is not found */ export declare function tagSession(sessionId: string, tag: string | null, options?: SessionMutationOptions): Promise; /** * List subagent IDs associated with a session. * * Scans the session's subagent transcript directory for `agent-*.jsonl` * files written by qodercli. * * @param sessionId - The parent session UUID * @param options.dir - Restrict search to this working directory * @returns Array of subagent IDs found in the session */ export declare function listSubagents(sessionId: string, options?: ListSubagentsOptions): Promise; /** * Get messages from a subagent transcript. * * Reads qodercli's per-subagent JSONL transcript from * `//subagents/agent-.jsonl`, follows the * `parentUuid` chain from the latest message, and returns user/assistant * messages in chronological order. * * @param sessionId - The parent session UUID * @param agentId - The subagent UUID * @param options.dir - Restrict search to this working directory * @param options.limit - Maximum number of messages to return * @param options.offset - Number of messages to skip * @returns Array of session messages from the subagent */ export declare function getSubagentMessages(sessionId: string, agentId: string, options?: GetSubagentMessagesOptions): Promise; /** Delete a session and all child transcripts from a local or external store. */ export declare function deleteSession(sessionId: string, options?: SessionMutationOptions): Promise;