/** * Letta Agent SDK * * Programmatic control of Letta Code CLI with persistent agent memory. * * @example * ```typescript * import { LettaAgentClient, createAgent, createSession, resumeSession } from '@letta-ai/letta-agent-sdk'; * * const client = new LettaAgentClient({ backend: 'local' }); * const agentId = await client.createAgent(); * const clientSession = client.resumeSession(agentId); * * // Create a new agent explicitly * const agentId = await createAgent(); * * // Resume default conversation on an agent * const session = resumeSession(agentId); * * // Resume specific conversation * const session = resumeSession('conv-xxx'); * * // Create new conversation on specific agent * const session = createSession(agentId); * * ``` */ import type { CreateSessionOptions, CreateAgentOptions, LettaCodeSession, SDKResultMessage, SendMessage } from "./types.js"; export type { CreateSessionOptions, CreateAgentOptions, LettaCodePersonalityId, LettaCodeBackend, LettaCodeEnvironment, LettaCodeLocalClientOptions, LettaCodeLocalAppServerOptions, LettaCodeRemoteClientOptions, LettaCodeCloudClientOptions, LettaCodeCloudSandboxOptions, GitHubRepositoryRef, LettaCodeClientOptions, LettaCodeClientSessionOptions, LettaCodeSession, LettaCodeSocketLike, LettaCodeSocketConstructor, LettaCodeReactNativeSocketConstructor, SDKMessage, SDKInitMessage, SDKAssistantMessage, SDKToolCallMessage, SDKToolResultMessage, SDKReasoningMessage, SDKResultMessage, SDKErrorCode, SDKStreamEventMessage, SDKStreamEventPayload, SDKStreamEventDeltaPayload, SDKStreamEventMessagePayload, SDKUnknownStreamEventPayload, SDKErrorMessage, SDKRetryMessage, SDKQueueItem, SDKQueueUpdateMessage, SDKLoopStatusMessage, SDKProtocolMessage, SDKProtocolCommand, SendCommandOptions, RecoverPendingApprovalsOptions, RecoverPendingApprovalsResult, ChangeDeviceStateOptions, RemoveQueuedMessageResult, GetDeviceStatusOptions, SessionDeviceStatus, SessionPendingControlRequest, SessionPermissionSuggestion, SessionDiffHunkLine, SessionDiffHunk, SessionDiffPreview, SkillSource, DreamingOptions, SessionDreamingOptions, DreamingTrigger, DreamingBehavior, EffectiveDreamingSettings, PermissionMode, ReasoningEffort, CanUseToolCallback, CanUseToolContext, CanUseToolPermissionSuggestion, CanUseToolResponse, CanUseToolResponseAllow, CanUseToolResponseDeny, TextContent, ImageContent, MessageContentItem, SendMessage, SendOptions, ListMessagesOptions, ListMessagesResult, ListModelsResult, LettaCodeModelEntry, UpdateModelOptions, UpdateModelResult, Repository, CreateRepositoryParams, ListRepositoriesParams, ListRepositoriesResult, RepositoryResource, RepositoryFileEntry, ListRepositoryFilesParams, ListRepositoryFilesResult, CreateRepositoryFileParams, RepositoryFile, UpdateRepositoryFileParams, RepositoryFileMutationResult, DeleteRepositoryFileParams, DeleteRepositoryFileResult, RepositoryVersion, ListRepositoryVersionsParams, GetRepositoryVersionParams, BootstrapStateOptions, BootstrapStateResult, AgentTool, AgentToolResult, AgentToolResultContent, AgentToolUpdateCallback, AnyAgentTool, McpServerConfig, McpStdioServerConfig, McpHttpServerConfig, McpSseServerConfig, McpServers, } from "./types.js"; export type { AgentRepositoriesClient, AgentRepository, AgentRepositoryRecompileTarget, AttachAgentRepositoryOptions, AgentsClient, ConversationsClient, LettaAgent, LettaConversation, LettaConversationMessage, ModelsClient, ListAgentsOptions, UpdateAgentOptions, ListConversationsOptions, CreateConversationOptions, ForkConversationOptions, UpdateConversationOptions, ConversationMessagesOptions, ConversationMessagesResult, DetachAgentRepositoryOptions, AgentRepositoryPermissions, } from "./management-types.js"; export { RepositoriesClient } from "./repositories.js"; export { ConversationForkHydrationError } from "./management-errors.js"; export type { Computer, ComputerMetadata, ComputerSelector, ComputersClient, ListComputersOptions, ListComputersResult, ResolvedComputer, } from "./computers.js"; export { LettaAgentClient } from "./client.js"; export { CloudManagedSandboxExpiredError } from "./cloud-session.js"; export { createReactNativeWebSocketConstructor } from "./websocket.js"; export { extractStreamTextDelta } from "./stream-events.js"; export { createTranscriptAccumulator } from "./transcript-accumulator.js"; export type { TranscriptAccumulator, TranscriptHistoryPage, TranscriptRebaseOptions, TranscriptRow, TranscriptRowIdentity, TranscriptRowKind, TranscriptTextKind, TranscriptTextRow, TranscriptToolCallRow, TranscriptToolCallStatus, TranscriptToolResult, } from "./transcript-accumulator.js"; export { jsonResult, readStringParam, readNumberParam, readBooleanParam, readStringArrayParam, } from "./tool-helpers.js"; /** * Create a new agent with a default conversation. * Returns the agentId which can be used with resumeSession or createSession. * * @example * ```typescript * // Create an agent with a git-backed memory filesystem. * const agentId = await createAgent({ * memfs: true, * systemPrompt: `You are a helpful coding assistant. Keep durable project * notes in focused Markdown files under reference/.`, * model: 'claude-sonnet-4', * tags: ['project:docs'] * }); * * // Personality presets are explicit opt-ins. * const memoAgentId = await createAgent({ personality: 'memo' }); * * // Then resume the default conversation: * const session = resumeSession(agentId); * ``` */ export declare function createAgent(options?: CreateAgentOptions): Promise; /** * Create a new conversation (session). * * Creates a new conversation on the specified agent. * * @example * ```typescript * // New conversation on specific agent * await using session = createSession(agentId); * ``` */ export declare function createSession(agentId: string, options?: CreateSessionOptions): LettaCodeSession; /** * Resume an existing session. * * - Pass an agent ID (agent-xxx) to resume the default conversation * - Pass a conversation ID (conv-xxx) to resume a specific conversation * * The default conversation always exists after createAgent, so you can: * `createAgent()` → `resumeSession(agentId)` without needing createSession first. * * @example * ```typescript * // Resume default conversation * await using session = resumeSession(agentId); * * // Resume specific conversation * await using session = resumeSession('conv-xxx'); * ``` */ export declare function resumeSession(id: string, options?: CreateSessionOptions): LettaCodeSession; export declare function prompt(message: SendMessage, agentId: string, options?: CreateSessionOptions): Promise; import type { ListMessagesOptions, ListMessagesResult } from "./types.js"; /** * Fetch conversation messages without requiring a pre-existing session. * * Creates a transient CLI subprocess, fetches the requested message page, and * closes the subprocess. Useful for prefetching conversation histories before * opening a full session (e.g. desktop sidebar warm-up). * * Routing follows the same agent/conversation semantics as session history: * - Pass a conv-xxx conversationId to read a specific conversation. * - Omit conversationId to read the agent's default conversation. * * @param agentId - Agent ID to fetch messages for. * @param options - Pagination / filtering options (same as ListMessagesOptions). * * @example * ```typescript * // Prefetch default conversation * const { messages } = await listMessagesDirect(agentId); * * // Prefetch a specific conversation * const { messages, hasMore, nextBefore } = await listMessagesDirect(agentId, { * conversationId: 'conv-abc', * limit: 20, * order: 'desc', * }); * ``` */ export declare function listMessagesDirect(agentId: string, options?: ListMessagesOptions): Promise; import type { ImageContent } from "./types.js"; /** * Create image content from a file path. * * @example * ```typescript * await session.send([ * { type: "text", text: "What's in this image?" }, * imageFromFile("./screenshot.png") * ]); * ``` */ export declare function imageFromFile(filePath: string): ImageContent; /** * Create image content from base64 data. * * @example * ```typescript * const base64 = fs.readFileSync("image.png").toString("base64"); * await session.send([ * { type: "text", text: "Describe this" }, * imageFromBase64(base64, "image/png") * ]); * ``` */ export declare function imageFromBase64(data: string, media_type?: ImageContent["source"]["media_type"]): ImageContent; /** * Create image content from a URL. * Fetches the image and converts to base64. * * @example * ```typescript * const img = await imageFromURL("https://example.com/image.png"); * await session.send([ * { type: "text", text: "What's this?" }, * img * ]); * ``` */ export declare function imageFromURL(url: string): Promise; //# sourceMappingURL=index.d.ts.map