import type { Express } from "express"; import { ProcessManager } from "./process-manager.js"; import { StructuredSessionManager } from "./structured-session-manager.js"; import { WandStorage } from "./storage.js"; import { ExecutionMode, SessionSnapshot, SessionSource, WandConfig } from "./types.js"; import { toSessionListItemDTO } from "./session-transport.js"; import { SessionRegistry } from "./session-registry.js"; import { type SessionDirectoryNode } from "./session-directory-tree.js"; export declare function parseExecutionMode(value: unknown, fallback: ExecutionMode): ExecutionMode; export declare function parseSessionCreationOrigin(body: { sessionSource?: unknown; automationId?: unknown; } | null | undefined): { sessionSource: SessionSource; automationId?: string; }; type SessionDeletionProcesses = Pick; type SessionDeletionStructured = Pick; /** * A Wand-managed session and its provider-native history represent the same * conversation. Delete both in one operation so the native history cannot * immediately reappear as a "non-Wand" session after the Wand row is removed. */ export declare function deleteSessionWithProviderHistory(processes: SessionDeletionProcesses, structured: SessionDeletionStructured, storage: Pick, id: string): void; type ProviderHistorySession = { claudeSessionId: string; cwd: string; firstUserMessage: string; timestamp: string; mtimeMs: number; hasConversation: boolean; managedByWand: boolean; provider?: "claude" | "codex" | "opencode" | "qoder"; }; type SessionListPageEntry = { type: "managed"; key: string; sortTimestamp: number; session: ReturnType; }; export interface SessionListPage { entries: SessionListPageEntry[]; offset: number; total: number; revision: string; } export interface SessionDirectoryTreeResponse { roots: SessionDirectoryNode[]; totalSessions: number; directoryCount: number; /** Session-entry revision, kept identical to /api/session-list for pagination compatibility. */ revision: string; /** Full directory-tree revision, including custom workspace names. */ treeRevision: string; } export declare function buildSessionListPage(sessions: SessionSnapshot[], offset: number, limit: number): SessionListPage; export declare function buildSessionDirectoryTree(sessions: SessionSnapshot[], customNames?: ReadonlyMap): SessionDirectoryTreeResponse; /** * Provider history is scanned by ProcessManager, but structured sessions live * in StructuredSessionManager. Annotate against the combined session list so a * structured conversation is not also exposed as a recoverable native history * entry. Return copies for matches because ProcessManager caches scan results. */ export declare function markManagedProviderHistory(history: T[], sessions: SessionSnapshot[], provider: "claude" | "codex" | "opencode" | "qoder"): T[]; export declare function registerSessionRoutes(app: Express, processes: ProcessManager, structured: StructuredSessionManager, storage: WandStorage, defaultMode: ExecutionMode, config: WandConfig, sessions: SessionRegistry, onSessionCreated?: (cwd: string | undefined | null) => void): void; export declare function registerClaudeHistoryRoutes(app: Express, processes: ProcessManager, _structured: StructuredSessionManager, storage: WandStorage, _sessionRegistry: SessionRegistry): void; export {};