Skip to content

Function: getStoredEvents()

Makaio Framework


Makaio Framework / services-core/session/orchestrator-testing / getStoredEvents

getStoredEvents(sessionId): Promise<({ eventId: string; payload: { adapterId: string; adapterName: string; adapterSessionId: string; agentId: string; cwd?: string; model?: string; role?: "lead" | "member"; sessionId: string; }; sessionId: string; timestamp: number; type: "agent.added"; } | { eventId: string; payload: { agentIds: string[]; content: string | { blocks: { content: string; type: "text"; } | { source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "image"; } | { source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "document"; } | { attachmentType: "file" | "directory"; displayName?: string; fileName: string; filePath: string; source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "attachment"; } | { content: string; metadata?: Record<…, …>; type: "reasoning"; } | { args: Record<string, unknown>; name: string; toolCallId: string; type: "tool_call"; } | { isError?: boolean; output: string; toolCallId: string; type: "tool_output"; } | ({ content: …; type: …; } | { source: …; type: …; } | { source: …; type: …; } | { attachmentType: …; displayName?: …; fileName: …; filePath: …; source: …; type: …; } | { content: …; metadata?: …; type: …; } | { args: …; name: …; toolCallId: …; type: …; } | { isError?: …; output: …; toolCallId: …; type: …; })[]; role?: "user" | "assistant" | "system"; }; messageId: string; origin?: "text" | "voice" | "compact"; sessionId: string; source?: "user" | "extension" | "system"; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.sent"; } | { eventId: string; payload: { agentId: string; messageId: string; sessionId: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.acknowledged"; } | { eventId: string; payload: { agentId: string; error?: string; mergedInto?: string; messageId: string; outcome: "error" | "completed" | "superseded" | "merged" | "cancelled" | "rejected"; sessionId: string; supersededBy?: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.completed"; } | { eventId: string; payload: { agentIds: string[]; initiator?: { source: "user" | "extension" | "system"; sourceId?: string; }; messageId: string; sessionId: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "turn.started"; } | { eventId: string; payload: { error?: string; initiator?: { source: "user" | "extension" | "system"; sourceId?: string; }; sessionId: string; success: boolean; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "turn.completed"; } | { eventId: string; payload: { messageId: string; role: "user" | "assistant"; turnId: string | null; }; sessionId: string; timestamp: number; type: "message"; } | { eventId: string; payload: { childSessionId: string; forkPointMessageId?: string; kind: "fork" | "branch" | "aside" | "subagent" | "compress" | "rewrite" | "coordinator"; parentSessionId: string; }; sessionId: string; timestamp: number; type: "branch.created"; } | { eventId: string; payload: { childSessionId: string; parentSessionId: string; resultJson?: string; resultMessageId?: string; }; sessionId: string; timestamp: number; type: "branch.merged"; } | { eventId: string; payload: { compressedMessageIds?: string[]; summaryJson: string; tokensAfter?: number; tokensBefore?: number; }; sessionId: string; timestamp: number; type: "squash"; } | { eventId: string; payload: Record<string, unknown>; sessionId: string; timestamp: number; type: string; })[]>

Defined in: ../../../packages/services/core/src/session/__tests__/shared.ts:105

Query stored session events.

string

Session ID to query

Promise<({ eventId: string; payload: { adapterId: string; adapterName: string; adapterSessionId: string; agentId: string; cwd?: string; model?: string; role?: "lead" | "member"; sessionId: string; }; sessionId: string; timestamp: number; type: "agent.added"; } | { eventId: string; payload: { agentIds: string[]; content: string | { blocks: { content: string; type: "text"; } | { source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "image"; } | { source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "document"; } | { attachmentType: "file" | "directory"; displayName?: string; fileName: string; filePath: string; source: { data: …; mimeType: …; type: …; } | { mimeType?: …; type: …; url: …; }; type: "attachment"; } | { content: string; metadata?: Record<…, …>; type: "reasoning"; } | { args: Record<string, unknown>; name: string; toolCallId: string; type: "tool_call"; } | { isError?: boolean; output: string; toolCallId: string; type: "tool_output"; } | ({ content: …; type: …; } | { source: …; type: …; } | { source: …; type: …; } | { attachmentType: …; displayName?: …; fileName: …; filePath: …; source: …; type: …; } | { content: …; metadata?: …; type: …; } | { args: …; name: …; toolCallId: …; type: …; } | { isError?: …; output: …; toolCallId: …; type: …; })[]; role?: "user" | "assistant" | "system"; }; messageId: string; origin?: "text" | "voice" | "compact"; sessionId: string; source?: "user" | "extension" | "system"; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.sent"; } | { eventId: string; payload: { agentId: string; messageId: string; sessionId: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.acknowledged"; } | { eventId: string; payload: { agentId: string; error?: string; mergedInto?: string; messageId: string; outcome: "error" | "completed" | "superseded" | "merged" | "cancelled" | "rejected"; sessionId: string; supersededBy?: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "user_message.completed"; } | { eventId: string; payload: { agentIds: string[]; initiator?: { source: "user" | "extension" | "system"; sourceId?: string; }; messageId: string; sessionId: string; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "turn.started"; } | { eventId: string; payload: { error?: string; initiator?: { source: "user" | "extension" | "system"; sourceId?: string; }; sessionId: string; success: boolean; turnId: string; turnNumber: number; }; sessionId: string; timestamp: number; type: "turn.completed"; } | { eventId: string; payload: { messageId: string; role: "user" | "assistant"; turnId: string | null; }; sessionId: string; timestamp: number; type: "message"; } | { eventId: string; payload: { childSessionId: string; forkPointMessageId?: string; kind: "fork" | "branch" | "aside" | "subagent" | "compress" | "rewrite" | "coordinator"; parentSessionId: string; }; sessionId: string; timestamp: number; type: "branch.created"; } | { eventId: string; payload: { childSessionId: string; parentSessionId: string; resultJson?: string; resultMessageId?: string; }; sessionId: string; timestamp: number; type: "branch.merged"; } | { eventId: string; payload: { compressedMessageIds?: string[]; summaryJson: string; tokensAfter?: number; tokensBefore?: number; }; sessionId: string; timestamp: number; type: "squash"; } | { eventId: string; payload: Record<string, unknown>; sessionId: string; timestamp: number; type: string; })[]>

Array of stored events