@anthropic-ai/claude-agent-sdk 0.2.109 → 0.2.110

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
@@ -182,13 +182,15 @@ export type RemoteCredentials = {
182
182
  };
183
183
  /**
184
184
  * Terminal authz failure from `POST /bridge` — retrying with the same inputs
185
- * is guaranteed to fail. Returned for 403 `error.resource: "untrusted_device"`
186
- * when `X-Trusted-Device-Token` is missing or revoked.
185
+ * is guaranteed to fail. Returned for 403 with `error.resource` set to
186
+ * `"untrusted_device"` (token missing/revoked — enroll) or
187
+ * `"session_stale_relogin"` (OAuth session older than the freshness window —
188
+ * re-authenticate).
187
189
  * @alpha
188
190
  */
189
191
  export type CredentialsFailure = {
190
192
  terminal: true;
191
- reason: 'untrusted_device';
193
+ reason: 'untrusted_device' | 'session_stale_relogin';
192
194
  };
193
195
  /**
194
196
  * Type guard for `fetchRemoteCredentials` results.
@@ -216,10 +218,10 @@ export declare function createCodeSession(baseUrl: string, accessToken: string,
216
218
  /**
217
219
  * `POST /v1/code/sessions/{id}/bridge` — mint a worker JWT for the session.
218
220
  * Returns credentials, a `CredentialsFailure` for terminal authz failures
219
- * (don't retry — re-enroll the device), or null on transient failure.
220
- * The call IS the worker register (bumps epoch server-side), so pass
221
- * `epoch: creds.worker_epoch` to `attachBridgeSession` to skip a redundant
222
- * register.
221
+ * (don't retry — see `CredentialsFailure.reason` for remediation), or null
222
+ * on transient failure. The call IS the worker register (bumps epoch
223
+ * server-side), so pass `epoch: creds.worker_epoch` to `attachBridgeSession`
224
+ * to skip a redundant register.
223
225
  *
224
226
  * `trustedDeviceToken` sets the `X-Trusted-Device-Token` header. Required
225
227
  * when the server's `sessions_elevated_auth_enforcement` flag is on