Session
Reference for the Session schema.
export type = {
// required
: string
: string
: string
: "cancelled" | "completed" | "failed" | "idle" | "paused" | "pending" | "running" | "stuck" | "waiting"
: number
// optional
?: string
?: string
?: string
?: number
// metadata
?: {
?: string
?: {
: string
: string
}
?: {
: number
: string
}
?: string
?: "build" | "data" | "debug" | "deploy" | "docs" | "explain" | "explore" | "plan" | "refactor" | "research" | "review" | "security" | "test"
?: string
}
}Sources
Each source's record of one agent's run. The OpenAI Agents SDK keeps a whole run, across the agents it hands off to, in RunState fields it marks internal, and the Vercel AI SDK keeps no record of a run.
Anomaly OpenCode
https://opencode.ai/v2/docs/api#session.get
type = {
?: string
: number
?: {
readonly : string
readonly :
| { readonly : "before"; readonly : string }
| { readonly : "through"; readonly : string }
}
: string
: { readonly : string; readonly ?: string | undefined }
?: { readonly [: string]: Json }
?: {
readonly : string
readonly : string
readonly ?: string | undefined
}
?: "failed" | "interrupted" | "succeeded"
?: string
?: readonly {
readonly : string
readonly : string
readonly : "allow" | "ask" | "deny"
}[]
: string
?: {
readonly : string
readonly ?: string | undefined
readonly ?: string | undefined
readonly ?:
| readonly {
readonly : string
readonly : string
readonly : number
readonly : number
readonly : "added" | "deleted" | "modified"
}[]
| undefined
}
?: string
: {
readonly : number
readonly : number
readonly ?: number | undefined
readonly ?: number | undefined
readonly ?: number | undefined
}
?: string
: {
readonly : number
readonly : number
readonly : number
readonly : { readonly : number; readonly : number }
}
}Claude Agent SDK
https://code.claude.com/docs/en/agent-sdk/typescript#return-type-sdksessioninfo
type = {
?: number
?: string
?: string
?: number
?: string
?: string
: number
: string
: string
?: string
}https://code.claude.com/docs/en/agent-sdk/typescript#sdktaskstartedmessage
type = {
?: boolean
: string
?: boolean
?: string
?: string
?: string
: string
?: boolean
?: number
?: string
: "task_started"
: string
?: string
?: string
: "system"
: `${string}-${string}-${string}-${string}-${string}`
?: string
}Claude Code
https://code.claude.com/docs/en/agent-view#list-sessions-as-json
type = {
?
?
?
?
?
?
?
}Cloudflare Agents
type = {
: string
?: boolean
?: AgentToolDisplayMetadata
?: string
?: unknown
?: AgentToolMilestone[]
: number
?: string
: AgentToolRunPart[]
?: AgentToolProgressSnapshot
?: AgentToolInterruptedReason
: string
: "aborted" | "completed" | "error" | "interrupted" | "running"
: { : string; : string }
?: string
}Mastra
https://mastra.ai/reference/agent-controller/session#display-state
type = {
: string
?: string
?: number
?: boolean
?: string
?: string
?: number
: "completed" | "error" | "running"
: string
: string
: { : string; : boolean }[]
}OpenAI Codex
https://learn.chatgpt.com/docs/app-server#threads
type = {
: string | null
: string | null
: string
: number
: string
: boolean
: string | null
: GitInfo | null
: ThreadHistoryMode
: string
: string | null
: string
: string | null
: string | null
: string | null
: string | null
: string
: string | null
: string | null
: number | null
: ThreadSection | null
: number | null
: string
: SessionSource
: ThreadStatus
: string | null
: Turn[]
: number
}Vercel eve
https://eve.dev/docs/reference/typescript-api#runtime-context-ctx
type = {
: {
readonly : string
readonly : SessionAuth
readonly : SessionTurn
readonly ?: SessionParent | undefined
readonly ?: SessionSchedule | undefined
readonly ?: SessionPredecessor | undefined
}
}https://eve.dev/docs/reference/typescript-api#runtime-context-ctx
type = {
: string
: string
: string
: SessionTurn
}