import type { AgentMessage, InputMessage } from './AgentMessage'; import type { GetThreadOptions } from './AgentRuntime'; export declare const AgentObjectType: { readonly Thread: "thread"; readonly ThreadRun: "thread.run"; }; export type AgentObjectType = (typeof AgentObjectType)[keyof typeof AgentObjectType]; export declare const RunStatus: { readonly Queued: "queued"; readonly InProgress: "in_progress"; readonly Completed: "completed"; readonly Failed: "failed"; readonly Cancelled: "cancelled"; readonly Cancelling: "cancelling"; readonly Expired: "expired"; }; export type RunStatus = (typeof RunStatus)[keyof typeof RunStatus]; export interface AgentRunConfig { maxIterations?: number; timeoutMs?: number; } export interface ThreadRecord { id: string; object: typeof AgentObjectType.Thread; /** * All messages in the thread, stored as SDK-format AgentMessage objects. * In OSSAgentStore the messages are stored separately as a JSONL file * and assembled on read — callers should treat this as a unified view * regardless of the underlying storage layout. */ messages: AgentMessage[]; metadata: Record; createdAt: number; } export interface RunRecord { id: string; object: typeof AgentObjectType.ThreadRun; threadId?: string; status: RunStatus; input: InputMessage[]; lastError?: { code: string; message: string; } | null; usage?: { promptTokens: number; completionTokens: number; totalTokens: number; } | null; config?: AgentRunConfig; metadata?: Record; createdAt: number; startedAt?: number | null; completedAt?: number | null; cancelledAt?: number | null; failedAt?: number | null; } export interface AgentStore { init?(): Promise; destroy?(): Promise; createThread(metadata?: Record): Promise; getThread(threadId: string, options?: GetThreadOptions): Promise; appendMessages(threadId: string, messages: AgentMessage[]): Promise; createRun(input: InputMessage[], threadId?: string, config?: AgentRunConfig, metadata?: Record): Promise; getRun(runId: string): Promise; updateRun(runId: string, updates: Partial): Promise; }