diff --git a/src/session.ts b/src/session.ts index 7709b8a..f803e2a 100644 --- a/src/session.ts +++ b/src/session.ts @@ -408,12 +408,14 @@ export class Session implements AsyncDisposable { duration_ms: number; total_cost_usd?: number; conversation_id: string; + stop_reason?: string; }; return { type: "result", success: msg.subtype === "success", result: msg.result, error: msg.subtype !== "success" ? msg.subtype : undefined, + stopReason: msg.stop_reason, durationMs: msg.duration_ms, totalCostUsd: msg.total_cost_usd, conversationId: msg.conversation_id, diff --git a/src/types.ts b/src/types.ts index 0f19b3d..45517a7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -279,6 +279,7 @@ export interface SDKResultMessage { success: boolean; result?: string; error?: string; + stopReason?: string; durationMs: number; totalCostUsd?: number; conversationId: string | null;