@anthropic-ai/claude-agent-sdk 0.3.206 → 0.3.208
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 +41 -3
- package/bridge.mjs +77 -77
- package/browser-sdk.js +32 -32
- package/manifest.json +41 -19
- package/manifest.zst.json +45 -23
- package/package.json +10 -10
- package/sdk-tools.d.ts +11 -2
- package/sdk.d.ts +18 -5
- package/sdk.mjs +61 -61
package/bridge.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export type AttachBridgeSessionOptions = {
|
|
|
150
150
|
ok: false;
|
|
151
151
|
error: string;
|
|
152
152
|
} | void;
|
|
153
|
-
onSetMaxThinkingTokens?: (tokens: number | null, thinkingDisplay?: 'summarized' | 'omitted' | null) => void;
|
|
153
|
+
onSetMaxThinkingTokens?: (tokens: number | null | undefined, thinkingDisplay?: 'summarized' | 'omitted' | null) => void;
|
|
154
154
|
/**
|
|
155
155
|
* `set_permission_mode` from claude.ai. Return an error verdict to send
|
|
156
156
|
* an error control_response (vs silently false-succeeding). Omit if
|
|
@@ -220,17 +220,55 @@ export declare function isCredentialsFailure(r: RemoteCredentials | CredentialsF
|
|
|
220
220
|
export type CodeSessionGitContext = {
|
|
221
221
|
gitRepoUrl: string;
|
|
222
222
|
branch: string;
|
|
223
|
+
/**
|
|
224
|
+
* The repo's default branch, when authoritatively known. LOAD-BEARING
|
|
225
|
+
* for branch continuity: when absent, `branch` is omitted from
|
|
226
|
+
* `outcomes.branches` entirely (the classification never acts on a
|
|
227
|
+
* guess), so the remote session works on a runner-generated branch
|
|
228
|
+
* instead of `branch`, with only a debug-level signal. Callers that
|
|
229
|
+
* want the session to check out AND push to `branch` must supply
|
|
230
|
+
* this — read `git symbolic-ref refs/remotes/origin/HEAD`, or run
|
|
231
|
+
* `git remote set-head origin -a` to repair a missing symref.
|
|
232
|
+
*/
|
|
223
233
|
defaultBranch?: string;
|
|
224
234
|
};
|
|
235
|
+
/**
|
|
236
|
+
* Caller-owned dedupe state for createCodeSession's branch-drop debug
|
|
237
|
+
* signal: create one object per logical create (outside your retry
|
|
238
|
+
* loop) and pass it to every attempt so the drop logs once per
|
|
239
|
+
* decision. Omit it to log on every attempt.
|
|
240
|
+
* @alpha
|
|
241
|
+
*/
|
|
242
|
+
export declare type BranchDropLogDedup = {
|
|
243
|
+
lastKey?: string | null;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Terminal 4xx from `POST /v1/code/sessions` for a recognized
|
|
247
|
+
* `session_grouping_id` rejection — retrying with the same inputs fails
|
|
248
|
+
* identically.
|
|
249
|
+
* @alpha
|
|
250
|
+
*/
|
|
251
|
+
export type CreateSessionFailure = {
|
|
252
|
+
terminal: true;
|
|
253
|
+
status: number;
|
|
254
|
+
detail: string | undefined;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Type guard for `createCodeSession` results.
|
|
258
|
+
* @alpha
|
|
259
|
+
*/
|
|
260
|
+
export declare function isCreateSessionFailure(r: string | CreateSessionFailure | null): r is CreateSessionFailure;
|
|
225
261
|
/**
|
|
226
262
|
* `POST /v1/code/sessions` — create a fresh CCR session. Returns the `cse_*`
|
|
227
|
-
* session id
|
|
263
|
+
* session id on success, a `CreateSessionFailure` for a recognized
|
|
264
|
+
* `session_grouping_id` rejection (terminal — don't retry), or null on any
|
|
265
|
+
* other failure (HTTP error, malformed response).
|
|
228
266
|
*
|
|
229
267
|
* Callers supply their own OAuth token — this is a thin HTTP wrapper with no
|
|
230
268
|
* implicit auth, so it works from any process (not just the CLI).
|
|
231
269
|
* @alpha
|
|
232
270
|
*/
|
|
233
|
-
export declare function createCodeSession(baseUrl: string, accessToken: string, title: string, timeoutMs: number, tags?: string[], gitContext?: CodeSessionGitContext, cwd?: string, model?: string): Promise<string | null>;
|
|
271
|
+
export declare function createCodeSession(baseUrl: string, accessToken: string, title: string, timeoutMs: number, tags?: string[], gitContext?: CodeSessionGitContext, cwd?: string, model?: string, sessionGroupingId?: string, dropLogDedup?: BranchDropLogDedup): Promise<string | CreateSessionFailure | null>;
|
|
234
272
|
/**
|
|
235
273
|
* `POST /v1/code/sessions/{id}/bridge` — mint a worker JWT for the session.
|
|
236
274
|
* Returns credentials, a `CredentialsFailure` for terminal authz failures
|