import { AgentArchitectureSessionOptions } from "../../lib/agent-architectures/base"; import type { ConversationBlock } from "./blocks"; export type AGENT_ARCHITECTURE_TYPE = "claude-agent-sdk" | "opencode"; /** * A file in the workspace during the session */ export type WorkspaceFile = { path: string; content: string | undefined; }; /** * Minimal session data for persistence layer. * Used for listing sessions and basic session info. * Does NOT include status - that's derived from runtime state. */ export interface PersistedSessionListData { /** * The id that comes from the agent app (ie Claude Agent SDK, Gemini CLI, etc...) -- not the id from external app that is using this server */ sessionId: string; type: AGENT_ARCHITECTURE_TYPE; /** * Runtime / execution options (like model selection, etc...) * * Depends on the architecture type */ sessionOptions?: AgentArchitectureSessionOptions; agentProfileReference: string; name?: string; lastActivity?: number; createdAt?: number; metadata?: Record; } /** * Full session data for persistence layer. * Includes raw transcripts and workspace files. * Does NOT include parsed blocks - those are computed at runtime. */ export interface PersistedSessionData extends PersistedSessionListData { /** * Stringified raw transcript blob from the agent application. Either the jsonl file for claude-agent-sdk or the json file for gemini-cli. */ rawTranscript?: string; /** * Stringified raw transcript blob for each subagent. Either the jsonl file for claude-agent-sdk or the json file for gemini-cli. */ subagents?: { id: string; rawTranscript?: string; }[]; /** * The workspace files used / created during the session. */ workspaceFiles: WorkspaceFile[]; } /** * Sandbox status values */ export type SandboxStatus = 'starting' | 'ready' | 'unhealthy' | 'terminated'; /** * Runtime state for a session. * This is computed/derived state, never persisted. */ export interface SessionRuntimeState { /** Whether the session is currently loaded in memory */ isLoaded: boolean; /** Sandbox state, null if no sandbox exists */ sandbox: { /** Sandbox ID - not available during 'starting' phase */ sandboxId?: string; status: SandboxStatus; /** Human-readable status message for UI display */ statusMessage?: string; restartCount: number; lastHealthCheck: number; } | null; } /** * Session data returned to clients in list views. * Combines persisted data with runtime state. */ export interface SessionListItem extends PersistedSessionListData { runtime: SessionRuntimeState; } /** * Full session data returned to clients. * Includes parsed blocks and subagent conversations. */ export interface RuntimeSessionData extends SessionListItem { blocks: ConversationBlock[]; workspaceFiles: WorkspaceFile[]; subagents: { id: string; blocks: ConversationBlock[]; }[]; } export interface CreateSessionArgs { agentProfileRef: string; architecture: AGENT_ARCHITECTURE_TYPE; command?: string; defaultWorkspaceFiles?: WorkspaceFile[]; sessionOptions?: AgentArchitectureSessionOptions; } //# sourceMappingURL=index.d.ts.map