type OpenCodeEventKind = "task.started" | "task.progress" | "permission.requested" | "task.stalled" | "task.failed" | "task.completed"; type EventScope = "session" | "global"; type SseFrame = { event?: string; id?: string; retry?: number; data: string; raw: string; }; type TypedEventV1 = { schema: "opencode.event.v1"; scope: EventScope; eventName?: string; eventId?: string; kind: OpenCodeEventKind | null; summary?: string; lifecycleState?: "planning" | "coding" | "verifying" | "blocked" | "running" | "awaiting_permission" | "stalled" | "failed" | "completed"; filesChanged?: string[]; verifySummary?: { command?: string; exit?: number | null; output_preview?: string | null; } | null; blockers?: string[]; completionSummary?: string | null; runId?: string; taskId?: string; sessionId?: string; timestamp: string; wrappers: string[]; payload: any; }; declare function parseSseFramesFromBuffer(input: string): { frames: SseFrame[]; remainder: string; }; declare function parseSseData(data: string): any; declare function unwrapGlobalPayload(raw: any): { payload: any; wrappers: string[]; }; declare function normalizeOpenCodeEvent(raw: any): { kind: OpenCodeEventKind | null; summary?: string; raw: any; lifecycleState?: TypedEventV1["lifecycleState"]; filesChanged?: string[]; verifySummary?: { command?: string; exit?: number | null; output_preview?: string | null; } | null; blockers?: string[]; completionSummary?: string | null; }; declare function normalizeTypedEventV1(frame: SseFrame, scope: EventScope): TypedEventV1; declare function summarizeLifecycle(events?: Array<{ kind?: OpenCodeEventKind | null; summary?: string; lifecycleState?: TypedEventV1["lifecycleState"]; filesChanged?: string[]; verifySummary?: { command?: string; exit?: number | null; output_preview?: string | null; } | null; blockers?: string[]; completionSummary?: string | null; timestamp?: string; }>): { currentState: "planning" | "coding" | "verifying" | "blocked" | "running" | "awaiting_permission" | "stalled" | "failed" | "completed" | null; current_state: "planning" | "coding" | "verifying" | "blocked" | "running" | "awaiting_permission" | "stalled" | "failed" | "completed" | null; last_event_kind: OpenCodeEventKind | null; last_event_at: string | null; files_changed: string[]; verify_summary: { command?: string; exit?: number | null; output_preview?: string | null; }[]; blockers: string[]; completion_summary: string | null; }; declare function resolveSessionId(input: { explicitSessionId?: string; runId?: string; taskId?: string; sessionKey?: string; artifactSessionId?: string; sessionList?: any[]; }): { sessionId?: string; strategy: "explicit" | "artifact" | "scored_fallback" | "latest" | "none"; score?: number; }; export { type EventScope, type OpenCodeEventKind, type SseFrame, type TypedEventV1, normalizeOpenCodeEvent, normalizeTypedEventV1, parseSseData, parseSseFramesFromBuffer, resolveSessionId, summarizeLifecycle, unwrapGlobalPayload };