From b0b82a2a3d9bafdec53c0d275613546cc89332e0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 10 Feb 2026 10:13:56 -0800 Subject: [PATCH] feat: expose stop_reason on SDKResultMessage (#30) --- src/session.ts | 2 ++ src/types.ts | 1 + 2 files changed, 3 insertions(+) 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;