@anthropic-ai/claude-agent-sdk 0.2.108 → 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/assistant.mjs +88 -89
- package/bridge.d.ts +9 -7
- package/bridge.mjs +63 -63
- package/browser-sdk.js +26 -26
- package/cli.js +3772 -3736
- package/manifest.json +18 -18
- package/manifest.zst.json +22 -22
- package/package.json +2 -2
- package/sdk-tools.d.ts +4 -0
- package/sdk.d.ts +87 -3
- package/sdk.mjs +47 -48
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
|
|
186
|
-
*
|
|
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 —
|
|
220
|
-
* The call IS the worker register (bumps epoch
|
|
221
|
-
* `epoch: creds.worker_epoch` to `attachBridgeSession`
|
|
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
|