@anthropic-ai/claude-agent-sdk 0.3.307 → 0.3.309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bridge.d.ts CHANGED
@@ -61,17 +61,21 @@ export type BridgeSessionHandle = {
61
61
  sendControlCancelRequest(requestId: string): void;
62
62
  /**
63
63
  * Swap the underlying transport in place with a fresh JWT (and epoch).
64
- * Carries the SSE sequence number so the server resumes the stream.
64
+ * Carries the SSE sequence number so the server resumes the stream, and
65
+ * hands the old transport's undelivered writes to the new one, including
66
+ * writes made after the transport died, so this call is also how a host
67
+ * recovers them after onClose fires.
65
68
  * Call this when the poll loop re-dispatches work for the same session
66
69
  * with a fresh secret (JWT is 4h; backend mints a new one every dispatch).
67
70
  *
68
71
  * Throws if `createV2ReplTransport` fails (registerWorker error, etc).
69
- * Caller should treat that as a close and drop this handle.
72
+ * Caller should treat that as a close and drop this handle; the
73
+ * undelivered writes are dropped with it.
70
74
  */
71
75
  reconnectTransport(opts: {
72
76
  ingressToken: string;
73
77
  apiBaseUrl: string;
74
- /** Omit to reuse the current transport's epoch (token-refresh reconnect); provide to override. */
78
+ /** Omit to reuse the current transport's epoch (token-refresh reconnect); provide to override. Pass a fresh one after a 4090. */
75
79
  epoch?: number;
76
80
  }): Promise<void>;
77
81
  /**
@@ -228,7 +232,11 @@ export type AttachBridgeSessionOptions = {
228
232
  * (heartbeat/write auth exhaustion — re-attach with a fresh secret,
229
233
  * like 401), 403/404 = permanent SSE HTTP rejection. Transient
230
234
  * disconnects (503, network blips) retry indefinitely inside
231
- * SSETransport and do NOT fire this.
235
+ * SSETransport and do NOT fire this. After it fires, the handle keeps
236
+ * writes it could not deliver: reconnectTransport() hands them to the
237
+ * rebuilt transport, and close() drops them. After a 4090 the epoch
238
+ * may be stale: pass one from a fresh /bridge call, since reusing a
239
+ * stale one closes again.
232
240
  */
233
241
  onClose?: (code?: number) => void;
234
242
  };