@anthropic-ai/claude-agent-sdk 0.3.168 → 0.3.170
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 +86 -83
- package/bridge.mjs +65 -65
- package/browser-sdk.d.ts +37 -4
- package/browser-sdk.js +36 -32
- package/manifest.json +19 -19
- package/manifest.zst.json +23 -23
- package/package.json +10 -10
- package/sdk-tools.d.ts +2 -2
- package/sdk.d.ts +320 -13
- package/sdk.mjs +57 -57
package/sdk.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare type AgentDefinition = {
|
|
|
53
53
|
*/
|
|
54
54
|
prompt: string;
|
|
55
55
|
/**
|
|
56
|
-
* Model alias (e.g. '
|
|
56
|
+
* Model alias (e.g. 'fable', 'opus', 'sonnet', 'haiku') or full model ID (e.g. 'claude-fable-5'). If omitted or 'inherit', uses the main model
|
|
57
57
|
*/
|
|
58
58
|
model?: string;
|
|
59
59
|
mcpServers?: AgentMcpServerSpec[];
|
|
@@ -298,6 +298,10 @@ declare type ControlErrorResponse = {
|
|
|
298
298
|
* Permission requests still awaiting a response. Sent on the `initialize` response so a client joining an already-initialized session learns about in-flight prompts.
|
|
299
299
|
*/
|
|
300
300
|
pending_permission_requests?: SDKControlRequest[];
|
|
301
|
+
/**
|
|
302
|
+
* request_user_dialog requests still awaiting a response. Sent on the `initialize` response (sibling of pending_permission_requests) so a client joining an already-initialized session can re-arm in-flight dialogs. Receivers must tolerate the same request_id also arriving as a live or replayed control_request frame and render it once.
|
|
303
|
+
*/
|
|
304
|
+
pending_user_dialog_requests?: SDKControlRequest[];
|
|
301
305
|
};
|
|
302
306
|
|
|
303
307
|
declare type ControlResponse = {
|
|
@@ -308,6 +312,10 @@ declare type ControlResponse = {
|
|
|
308
312
|
* Permission requests still awaiting a response. Sent on the `initialize` response so a client joining an already-initialized session learns about in-flight prompts.
|
|
309
313
|
*/
|
|
310
314
|
pending_permission_requests?: SDKControlRequest[];
|
|
315
|
+
/**
|
|
316
|
+
* request_user_dialog requests still awaiting a response. Sent on the `initialize` response (sibling of pending_permission_requests) so a client joining an already-initialized session can re-arm in-flight dialogs. Receivers must tolerate the same request_id also arriving as a live or replayed control_request frame and render it once.
|
|
317
|
+
*/
|
|
318
|
+
pending_user_dialog_requests?: SDKControlRequest[];
|
|
311
319
|
};
|
|
312
320
|
|
|
313
321
|
declare namespace coreTypes {
|
|
@@ -405,6 +413,7 @@ declare namespace coreTypes {
|
|
|
405
413
|
SDKMessageOrigin,
|
|
406
414
|
SDKMessage,
|
|
407
415
|
SDKMirrorErrorMessage,
|
|
416
|
+
SDKModelRefusalFallbackMessage,
|
|
408
417
|
SDKNotificationMessage,
|
|
409
418
|
SDKPartialAssistantMessage,
|
|
410
419
|
SDKPermissionDenial,
|
|
@@ -529,7 +538,7 @@ export declare function deleteSession(_sessionId: string, _options?: SessionMuta
|
|
|
529
538
|
* - `'low'` — Minimal thinking, fastest responses
|
|
530
539
|
* - `'medium'` — Moderate thinking
|
|
531
540
|
* - `'high'` — Deep reasoning (default)
|
|
532
|
-
* - `'xhigh'` — Deeper than high (Opus 4.7+; falls back to `'high'` elsewhere)
|
|
541
|
+
* - `'xhigh'` — Deeper than high (Fable 5, Opus 4.7+; falls back to `'high'` elsewhere)
|
|
533
542
|
* - `'max'` — Maximum effort (select models only)
|
|
534
543
|
*/
|
|
535
544
|
export declare type EffortLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
@@ -1223,6 +1232,7 @@ export declare type ModelInfo = {
|
|
|
1223
1232
|
* Whether this model supports auto mode
|
|
1224
1233
|
*/
|
|
1225
1234
|
supportsAutoMode?: boolean;
|
|
1235
|
+
|
|
1226
1236
|
};
|
|
1227
1237
|
|
|
1228
1238
|
export declare type ModelUsage = {
|
|
@@ -1500,11 +1510,37 @@ export declare type Options = {
|
|
|
1500
1510
|
* dialogs the CLI asks the host to render. Each `dialogKind` defines its
|
|
1501
1511
|
* own payload and result shape.
|
|
1502
1512
|
*
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1513
|
+
* When the host answers `{behavior: 'cancelled'}` — the required answer
|
|
1514
|
+
* for an unrecognized `dialogKind` — the CLI applies the dialog's default
|
|
1515
|
+
* behavior. If the callback is not provided at all, the SDK sends no
|
|
1516
|
+
* answer: on a multi-client session another attached client may be the
|
|
1517
|
+
* declared renderer, and an auto-reply from this one would settle the
|
|
1518
|
+
* dialog out from under it. An unanswered dialog is bounded by the CLI's
|
|
1519
|
+
* park deadline.
|
|
1506
1520
|
*/
|
|
1507
1521
|
onUserDialog?: OnUserDialog;
|
|
1522
|
+
/**
|
|
1523
|
+
* Dialog kinds this consumer's `onUserDialog` can actually render
|
|
1524
|
+
* (`request_user_dialog` `dialog_kind` values, e.g.
|
|
1525
|
+
* 'refusal_fallback_prompt'). Declare only kinds your UI genuinely
|
|
1526
|
+
* displays and answers. Providing `onUserDialog` alone does NOT opt the
|
|
1527
|
+
* consumer into receiving dialogs — the CLI only emits a dialog kind
|
|
1528
|
+
* declared here.
|
|
1529
|
+
*
|
|
1530
|
+
* The CLI fails closed on absence: a dialog kind not declared here is
|
|
1531
|
+
* never emitted to this session — the flow behind it degrades to its
|
|
1532
|
+
* no-dialog behavior instead (for 'refusal_fallback_prompt', the classic
|
|
1533
|
+
* refusal error message ends the turn). Omitting the option entirely
|
|
1534
|
+
* means no dialogs are emitted, even with `onUserDialog` wired.
|
|
1535
|
+
*
|
|
1536
|
+
* Requires `onUserDialog`; passing a non-empty list without the callback
|
|
1537
|
+
* throws at option intake. On multi-client (remote) sessions the first
|
|
1538
|
+
* attached client's declaration wins for the worker's lifetime, and the
|
|
1539
|
+
* winning declaration is persisted to worker metadata so it survives
|
|
1540
|
+
* worker restarts (restored as a default that the next epoch's first
|
|
1541
|
+
* explicit declaration overrides).
|
|
1542
|
+
*/
|
|
1543
|
+
supportedDialogKinds?: string[];
|
|
1508
1544
|
/**
|
|
1509
1545
|
* When false, disables session persistence to disk. Sessions will not be
|
|
1510
1546
|
* saved to ~/.claude/projects/ and cannot be resumed later. Useful for
|
|
@@ -1585,8 +1621,8 @@ export declare type Options = {
|
|
|
1585
1621
|
* - `'low'` — Minimal thinking, fastest responses
|
|
1586
1622
|
* - `'medium'` — Moderate thinking
|
|
1587
1623
|
* - `'high'` — Deep reasoning (default)
|
|
1588
|
-
* - `'xhigh'` — Deeper than high (Opus 4.7+)
|
|
1589
|
-
* - `'max'` — Maximum effort (Opus 4.6+, Sonnet 4.6)
|
|
1624
|
+
* - `'xhigh'` — Deeper than high (Fable 5, Opus 4.7+)
|
|
1625
|
+
* - `'max'` — Maximum effort (Fable 5, Opus 4.6+, Sonnet 4.6)
|
|
1590
1626
|
*
|
|
1591
1627
|
* @see https://docs.anthropic.com/en/docs/build-with-claude/effort
|
|
1592
1628
|
*/
|
|
@@ -1637,7 +1673,7 @@ export declare type Options = {
|
|
|
1637
1673
|
mcpServers?: Record<string, McpServerConfig>;
|
|
1638
1674
|
/**
|
|
1639
1675
|
* Claude model to use. Defaults to the CLI default model.
|
|
1640
|
-
* Examples: 'claude-sonnet-4-6', 'claude-opus-4-8'
|
|
1676
|
+
* Examples: 'claude-sonnet-4-6', 'claude-opus-4-8', 'claude-fable-5'
|
|
1641
1677
|
*/
|
|
1642
1678
|
model?: string;
|
|
1643
1679
|
/**
|
|
@@ -2296,6 +2332,20 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2296
2332
|
* @returns Context usage breakdown including token counts per category and total usage
|
|
2297
2333
|
*/
|
|
2298
2334
|
getContextUsage(): Promise<SDKControlGetContextUsageResponse>;
|
|
2335
|
+
/**
|
|
2336
|
+
* Get the structured data behind the `/usage` command: session cost and
|
|
2337
|
+
* token usage totals plus claude.ai plan rate-limit utilization windows
|
|
2338
|
+
* (5-hour, 7-day, per-model) when available. `rate_limits_available` is
|
|
2339
|
+
* false (and `rate_limits` null) for API key, Bedrock, Vertex, and other
|
|
2340
|
+
* sessions where plan limits do not apply.
|
|
2341
|
+
*
|
|
2342
|
+
* EXPERIMENTAL: this API is unstable and may change or be removed in any
|
|
2343
|
+
* release without notice — do not rely on it yet. The method name will
|
|
2344
|
+
* change when the API is stabilized.
|
|
2345
|
+
*
|
|
2346
|
+
* @returns Structured session cost/usage data and plan rate-limit utilization
|
|
2347
|
+
*/
|
|
2348
|
+
usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(): Promise<SDKControlGetUsageResponse>;
|
|
2299
2349
|
/**
|
|
2300
2350
|
* Read a file from the session's filesystem for the remote sidebar
|
|
2301
2351
|
* viewer. Path is resolved against cwd and gated by the same
|
|
@@ -2647,6 +2697,10 @@ export declare type SDKAssistantMessage = {
|
|
|
2647
2697
|
uuid: UUID;
|
|
2648
2698
|
session_id: string;
|
|
2649
2699
|
request_id?: string;
|
|
2700
|
+
/**
|
|
2701
|
+
* Wire uuids of previously-delivered messages that this message replaces (refusal-fallback supersede). The list can include tombstoned tool_result frames from the refused leg, not only assistant frames. Evict the named messages on arrival and treat this frame as their canonical replacement. Idempotent with the end-of-turn model_refusal_fallback notice, whose retracted_message_uuids remains the complete audit record for the turn.
|
|
2702
|
+
*/
|
|
2703
|
+
supersedes?: UUID[];
|
|
2650
2704
|
/**
|
|
2651
2705
|
* Subagent type that produced this message.
|
|
2652
2706
|
*/
|
|
@@ -2702,6 +2756,10 @@ export declare type SDKCompactBoundaryMessage = {
|
|
|
2702
2756
|
pre_tokens: number;
|
|
2703
2757
|
post_tokens?: number;
|
|
2704
2758
|
duration_ms?: number;
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
|
|
2705
2763
|
/**
|
|
2706
2764
|
* Relink info for messagesToKeep. Loaders splice the preserved segment at anchor_uuid (summary for suffix-preserving, boundary for prefix-preserving partial compact) so resume includes preserved content. Unset when compaction summarizes everything (no messagesToKeep).
|
|
2707
2765
|
*/
|
|
@@ -2716,8 +2774,10 @@ export declare type SDKCompactBoundaryMessage = {
|
|
|
2716
2774
|
preserved_messages?: {
|
|
2717
2775
|
anchor_uuid: UUID;
|
|
2718
2776
|
uuids: UUID[];
|
|
2777
|
+
|
|
2719
2778
|
};
|
|
2720
2779
|
};
|
|
2780
|
+
|
|
2721
2781
|
uuid: UUID;
|
|
2722
2782
|
session_id: string;
|
|
2723
2783
|
};
|
|
@@ -2913,6 +2973,215 @@ declare type SDKControlGetSettingsRequest = {
|
|
|
2913
2973
|
subtype: 'get_settings';
|
|
2914
2974
|
};
|
|
2915
2975
|
|
|
2976
|
+
/**
|
|
2977
|
+
* Requests the structured /usage data: session cost/usage totals plus claude.ai plan rate-limit utilization when available. Experimental — the response shape may change.
|
|
2978
|
+
*/
|
|
2979
|
+
declare type SDKControlGetUsageRequest = {
|
|
2980
|
+
subtype: 'get_usage';
|
|
2981
|
+
};
|
|
2982
|
+
|
|
2983
|
+
/**
|
|
2984
|
+
* Structured /usage data: session cost/usage totals plus claude.ai plan rate-limit utilization. Experimental — the shape may change.
|
|
2985
|
+
*/
|
|
2986
|
+
export declare type SDKControlGetUsageResponse = {
|
|
2987
|
+
/**
|
|
2988
|
+
* Cost and usage accumulated by the current session.
|
|
2989
|
+
*/
|
|
2990
|
+
session: {
|
|
2991
|
+
total_cost_usd: number;
|
|
2992
|
+
total_api_duration_ms: number;
|
|
2993
|
+
total_duration_ms: number;
|
|
2994
|
+
total_lines_added: number;
|
|
2995
|
+
total_lines_removed: number;
|
|
2996
|
+
model_usage: Record<string, coreTypes.ModelUsage>;
|
|
2997
|
+
};
|
|
2998
|
+
/**
|
|
2999
|
+
* Claude.ai subscription type ('pro', 'max', 'team', 'enterprise') or null for API key / 3P provider sessions.
|
|
3000
|
+
*/
|
|
3001
|
+
subscription_type: string | null;
|
|
3002
|
+
/**
|
|
3003
|
+
* False when plan rate limits do not apply (API key, Bedrock, Vertex, or missing profile scope) — rate_limits will be null.
|
|
3004
|
+
*/
|
|
3005
|
+
rate_limits_available: boolean;
|
|
3006
|
+
/**
|
|
3007
|
+
* Plan rate-limit utilization windows from the claude.ai usage endpoint, or null when unavailable.
|
|
3008
|
+
*/
|
|
3009
|
+
rate_limits: {
|
|
3010
|
+
five_hour?: {
|
|
3011
|
+
/**
|
|
3012
|
+
* Percentage of the window used, 0-100.
|
|
3013
|
+
*/
|
|
3014
|
+
utilization: number | null;
|
|
3015
|
+
/**
|
|
3016
|
+
* ISO 8601 timestamp when the window resets.
|
|
3017
|
+
*/
|
|
3018
|
+
resets_at: string | null;
|
|
3019
|
+
} | null;
|
|
3020
|
+
seven_day?: {
|
|
3021
|
+
/**
|
|
3022
|
+
* Percentage of the window used, 0-100.
|
|
3023
|
+
*/
|
|
3024
|
+
utilization: number | null;
|
|
3025
|
+
/**
|
|
3026
|
+
* ISO 8601 timestamp when the window resets.
|
|
3027
|
+
*/
|
|
3028
|
+
resets_at: string | null;
|
|
3029
|
+
} | null;
|
|
3030
|
+
seven_day_oauth_apps?: {
|
|
3031
|
+
/**
|
|
3032
|
+
* Percentage of the window used, 0-100.
|
|
3033
|
+
*/
|
|
3034
|
+
utilization: number | null;
|
|
3035
|
+
/**
|
|
3036
|
+
* ISO 8601 timestamp when the window resets.
|
|
3037
|
+
*/
|
|
3038
|
+
resets_at: string | null;
|
|
3039
|
+
} | null;
|
|
3040
|
+
seven_day_opus?: {
|
|
3041
|
+
/**
|
|
3042
|
+
* Percentage of the window used, 0-100.
|
|
3043
|
+
*/
|
|
3044
|
+
utilization: number | null;
|
|
3045
|
+
/**
|
|
3046
|
+
* ISO 8601 timestamp when the window resets.
|
|
3047
|
+
*/
|
|
3048
|
+
resets_at: string | null;
|
|
3049
|
+
} | null;
|
|
3050
|
+
seven_day_sonnet?: {
|
|
3051
|
+
/**
|
|
3052
|
+
* Percentage of the window used, 0-100.
|
|
3053
|
+
*/
|
|
3054
|
+
utilization: number | null;
|
|
3055
|
+
/**
|
|
3056
|
+
* ISO 8601 timestamp when the window resets.
|
|
3057
|
+
*/
|
|
3058
|
+
resets_at: string | null;
|
|
3059
|
+
} | null;
|
|
3060
|
+
extra_usage?: {
|
|
3061
|
+
is_enabled: boolean;
|
|
3062
|
+
monthly_limit: number | null;
|
|
3063
|
+
used_credits: number | null;
|
|
3064
|
+
utilization: number | null;
|
|
3065
|
+
currency?: string | null;
|
|
3066
|
+
} | null;
|
|
3067
|
+
} | null;
|
|
3068
|
+
/**
|
|
3069
|
+
* What's contributing to limits usage, from a scan of local transcripts on this machine (the same data the /usage dialog renders): behavioral characteristics plus per-skill/agent/plugin/MCP-server attribution. Approximate, excludes other devices and claude.ai. Null for non-claude.ai-subscriber sessions (mirrors the dialog) or when the scan fails.
|
|
3070
|
+
*/
|
|
3071
|
+
behaviors: {
|
|
3072
|
+
/**
|
|
3073
|
+
* Last 24 hours.
|
|
3074
|
+
*/
|
|
3075
|
+
day: {
|
|
3076
|
+
/**
|
|
3077
|
+
* API requests found in local transcripts for this window.
|
|
3078
|
+
*/
|
|
3079
|
+
request_count: number;
|
|
3080
|
+
/**
|
|
3081
|
+
* Distinct sessions observed in this window.
|
|
3082
|
+
*/
|
|
3083
|
+
session_count: number;
|
|
3084
|
+
/**
|
|
3085
|
+
* Behavioral characteristics of local usage. Categories overlap — this is not a partition, so percentages do not sum to 100.
|
|
3086
|
+
*/
|
|
3087
|
+
behaviors: {
|
|
3088
|
+
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron';
|
|
3089
|
+
/**
|
|
3090
|
+
* Share of the weighted local usage attributed to this behavior, 0-100.
|
|
3091
|
+
*/
|
|
3092
|
+
pct: number;
|
|
3093
|
+
/**
|
|
3094
|
+
* Requests in this window exhibiting the behavior.
|
|
3095
|
+
*/
|
|
3096
|
+
count: number;
|
|
3097
|
+
}[];
|
|
3098
|
+
agents: {
|
|
3099
|
+
name: string;
|
|
3100
|
+
/**
|
|
3101
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3102
|
+
*/
|
|
3103
|
+
pct: number;
|
|
3104
|
+
}[];
|
|
3105
|
+
skills: {
|
|
3106
|
+
name: string;
|
|
3107
|
+
/**
|
|
3108
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3109
|
+
*/
|
|
3110
|
+
pct: number;
|
|
3111
|
+
}[];
|
|
3112
|
+
plugins: {
|
|
3113
|
+
name: string;
|
|
3114
|
+
/**
|
|
3115
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3116
|
+
*/
|
|
3117
|
+
pct: number;
|
|
3118
|
+
}[];
|
|
3119
|
+
mcp_servers: {
|
|
3120
|
+
name: string;
|
|
3121
|
+
/**
|
|
3122
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3123
|
+
*/
|
|
3124
|
+
pct: number;
|
|
3125
|
+
}[];
|
|
3126
|
+
};
|
|
3127
|
+
/**
|
|
3128
|
+
* Last 7 days.
|
|
3129
|
+
*/
|
|
3130
|
+
week: {
|
|
3131
|
+
/**
|
|
3132
|
+
* API requests found in local transcripts for this window.
|
|
3133
|
+
*/
|
|
3134
|
+
request_count: number;
|
|
3135
|
+
/**
|
|
3136
|
+
* Distinct sessions observed in this window.
|
|
3137
|
+
*/
|
|
3138
|
+
session_count: number;
|
|
3139
|
+
/**
|
|
3140
|
+
* Behavioral characteristics of local usage. Categories overlap — this is not a partition, so percentages do not sum to 100.
|
|
3141
|
+
*/
|
|
3142
|
+
behaviors: {
|
|
3143
|
+
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron';
|
|
3144
|
+
/**
|
|
3145
|
+
* Share of the weighted local usage attributed to this behavior, 0-100.
|
|
3146
|
+
*/
|
|
3147
|
+
pct: number;
|
|
3148
|
+
/**
|
|
3149
|
+
* Requests in this window exhibiting the behavior.
|
|
3150
|
+
*/
|
|
3151
|
+
count: number;
|
|
3152
|
+
}[];
|
|
3153
|
+
agents: {
|
|
3154
|
+
name: string;
|
|
3155
|
+
/**
|
|
3156
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3157
|
+
*/
|
|
3158
|
+
pct: number;
|
|
3159
|
+
}[];
|
|
3160
|
+
skills: {
|
|
3161
|
+
name: string;
|
|
3162
|
+
/**
|
|
3163
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3164
|
+
*/
|
|
3165
|
+
pct: number;
|
|
3166
|
+
}[];
|
|
3167
|
+
plugins: {
|
|
3168
|
+
name: string;
|
|
3169
|
+
/**
|
|
3170
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3171
|
+
*/
|
|
3172
|
+
pct: number;
|
|
3173
|
+
}[];
|
|
3174
|
+
mcp_servers: {
|
|
3175
|
+
name: string;
|
|
3176
|
+
/**
|
|
3177
|
+
* Share of the weighted local usage attributed to this item, 0-100.
|
|
3178
|
+
*/
|
|
3179
|
+
pct: number;
|
|
3180
|
+
}[];
|
|
3181
|
+
};
|
|
3182
|
+
} | null;
|
|
3183
|
+
};
|
|
3184
|
+
|
|
2916
3185
|
/**
|
|
2917
3186
|
* Initializes the SDK session with hooks, MCP servers, and agent configuration.
|
|
2918
3187
|
*/
|
|
@@ -2949,6 +3218,10 @@ declare type SDKControlInitializeRequest = {
|
|
|
2949
3218
|
promptSuggestions?: boolean;
|
|
2950
3219
|
agentProgressSummaries?: boolean;
|
|
2951
3220
|
forwardSubagentText?: boolean;
|
|
3221
|
+
/**
|
|
3222
|
+
* Dialog kinds (request_user_dialog `dialog_kind` values) this consumer's onUserDialog can actually render. The CLI treats ABSENCE as 'cannot display' and fails closed: without the kind declared here, a dialog-gated flow degrades to its no-dialog behavior (for 'refusal_fallback_prompt', the classic refusal error) instead of parking a dialog the consumer may mishandle. First-attached-client-wins on multi-client sessions; later initializes do not change it.
|
|
3223
|
+
*/
|
|
3224
|
+
supportedDialogKinds?: string[];
|
|
2952
3225
|
};
|
|
2953
3226
|
|
|
2954
3227
|
/**
|
|
@@ -2960,6 +3233,7 @@ export declare type SDKControlInitializeResponse = {
|
|
|
2960
3233
|
output_style: string;
|
|
2961
3234
|
available_output_styles: string[];
|
|
2962
3235
|
models: coreTypes.ModelInfo[];
|
|
3236
|
+
|
|
2963
3237
|
/**
|
|
2964
3238
|
* Information about the logged in user's account.
|
|
2965
3239
|
*/
|
|
@@ -3141,7 +3415,7 @@ export declare type SDKControlRequest = {
|
|
|
3141
3415
|
request: SDKControlRequestInner;
|
|
3142
3416
|
};
|
|
3143
3417
|
|
|
3144
|
-
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlChannelEnableRequest | SDKControlEndSessionRequest | SDKControlMcpAuthenticateRequest | SDKControlMcpClearAuthRequest | SDKControlMcpOAuthCallbackUrlRequest | SDKControlClaudeAuthenticateRequest | SDKControlClaudeOAuthCallbackRequest | SDKControlClaudeOAuthWaitForCompletionRequest | SDKControlRemoteControlRequest | SDKControlGenerateSessionTitleRequest | SDKControlSideQuestionRequest | SDKControlUltrareviewLaunchRequest | SDKControlStageFileRequest | SDKControlMessageRatedRequest | SDKControlOAuthTokenRefreshRequest | SDKControlHostAuthTokenRefreshRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlSubmitFeedbackRequest;
|
|
3418
|
+
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlChannelEnableRequest | SDKControlEndSessionRequest | SDKControlMcpAuthenticateRequest | SDKControlMcpClearAuthRequest | SDKControlMcpOAuthCallbackUrlRequest | SDKControlClaudeAuthenticateRequest | SDKControlClaudeOAuthCallbackRequest | SDKControlClaudeOAuthWaitForCompletionRequest | SDKControlRemoteControlRequest | SDKControlGenerateSessionTitleRequest | SDKControlSideQuestionRequest | SDKControlUltrareviewLaunchRequest | SDKControlStageFileRequest | SDKControlMessageRatedRequest | SDKControlOAuthTokenRefreshRequest | SDKControlHostAuthTokenRefreshRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlSubmitFeedbackRequest;
|
|
3145
3419
|
|
|
3146
3420
|
/**
|
|
3147
3421
|
* Requests the SDK consumer to render a tool-driven blocking dialog and return the user choice. Used by tools that previously rendered Ink JSX via setToolJSX with an onDone callback.
|
|
@@ -3374,7 +3648,7 @@ export declare type SDKMemoryRecallMessage = {
|
|
|
3374
3648
|
session_id: string;
|
|
3375
3649
|
};
|
|
3376
3650
|
|
|
3377
|
-
export declare type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKStatusMessage | SDKAPIRetryMessage | SDKLocalCommandOutputMessage | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPluginInstallMessage | SDKToolProgressMessage | SDKAuthStatusMessage | SDKTaskNotificationMessage | SDKTaskStartedMessage | SDKTaskUpdatedMessage | SDKTaskProgressMessage | SDKThinkingTokensMessage | SDKSessionStateChangedMessage | SDKCommandsChangedMessage | SDKNotificationMessage | SDKFilesPersistedEvent | SDKToolUseSummaryMessage | SDKMemoryRecallMessage | SDKRateLimitEvent | SDKElicitationCompleteMessage | SDKPermissionDeniedMessage | SDKPromptSuggestionMessage | SDKMirrorErrorMessage;
|
|
3651
|
+
export declare type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKStatusMessage | SDKAPIRetryMessage | SDKModelRefusalFallbackMessage | SDKLocalCommandOutputMessage | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPluginInstallMessage | SDKToolProgressMessage | SDKAuthStatusMessage | SDKTaskNotificationMessage | SDKTaskStartedMessage | SDKTaskUpdatedMessage | SDKTaskProgressMessage | SDKThinkingTokensMessage | SDKSessionStateChangedMessage | SDKCommandsChangedMessage | SDKNotificationMessage | SDKFilesPersistedEvent | SDKToolUseSummaryMessage | SDKMemoryRecallMessage | SDKRateLimitEvent | SDKElicitationCompleteMessage | SDKPermissionDeniedMessage | SDKPromptSuggestionMessage | SDKMirrorErrorMessage;
|
|
3378
3652
|
|
|
3379
3653
|
/**
|
|
3380
3654
|
* Provenance of a user-role message (peer session, team lead, channel). Absent or `human` means keyboard input from the user.
|
|
@@ -3412,6 +3686,34 @@ export declare type SDKMirrorErrorMessage = {
|
|
|
3412
3686
|
session_id: string;
|
|
3413
3687
|
};
|
|
3414
3688
|
|
|
3689
|
+
/**
|
|
3690
|
+
* Emitted when the primary model ends the stream with stop_reason "refusal" and the turn is retried once on a fallback model with the swap made persistent for the session (direction: "retry"). "revert" and "sticky" are retained in the enum for SDK-consumer compat and are no longer emitted.
|
|
3691
|
+
*/
|
|
3692
|
+
export declare type SDKModelRefusalFallbackMessage = {
|
|
3693
|
+
type: 'system';
|
|
3694
|
+
subtype: 'model_refusal_fallback';
|
|
3695
|
+
trigger: 'refusal';
|
|
3696
|
+
direction: 'retry' | 'revert' | 'sticky';
|
|
3697
|
+
original_model: string;
|
|
3698
|
+
fallback_model: string;
|
|
3699
|
+
request_id: string | null;
|
|
3700
|
+
/**
|
|
3701
|
+
* stop_details.category from the refused API response ("cyber", "bio", …). Open string — new categories ship on the wire ahead of schema updates. null when the response carried no category (normal, not an error). Absent when emitted by an older CLI.
|
|
3702
|
+
*/
|
|
3703
|
+
api_refusal_category?: string | null;
|
|
3704
|
+
/**
|
|
3705
|
+
* stop_details.explanation from the refused API response. Unstable human prose — display only, never parse. null/absent under the same rules as api_refusal_category.
|
|
3706
|
+
*/
|
|
3707
|
+
api_refusal_explanation?: string | null;
|
|
3708
|
+
/**
|
|
3709
|
+
* Wire uuids of the messages this fallback retracted — the refused partial as the consumer received it (one uuid per normalized SDK message; multi-block messages carry per-block derived uuids) plus any tombstoned tool_results. Emitted AFTER the retraction, so this is a resolution-time eviction signal: remove these messages from transcript state on receipt. Eviction is idempotent — unknown or already-removed uuids are a no-op. Absent when emitted by an older CLI.
|
|
3710
|
+
*/
|
|
3711
|
+
retracted_message_uuids?: string[];
|
|
3712
|
+
content: string;
|
|
3713
|
+
uuid: UUID;
|
|
3714
|
+
session_id: string;
|
|
3715
|
+
};
|
|
3716
|
+
|
|
3415
3717
|
/**
|
|
3416
3718
|
* Loop-side text notification. Mirrors the interactive REPL notification queue (key/priority/timeout). JSX notifications are not emitted on this channel.
|
|
3417
3719
|
*/
|
|
@@ -3532,6 +3834,7 @@ export declare type SDKRateLimitInfo = {
|
|
|
3532
3834
|
overageResetsAt?: number;
|
|
3533
3835
|
overageDisabledReason?: 'overage_not_provisioned' | 'org_level_disabled' | 'org_level_disabled_until' | 'out_of_credits' | 'seat_tier_level_disabled' | 'member_level_disabled' | 'seat_tier_zero_credit_limit' | 'group_zero_credit_limit' | 'member_zero_credit_limit' | 'org_service_level_disabled' | 'no_limits_configured' | 'fetch_error' | 'unknown';
|
|
3534
3836
|
isUsingOverage?: boolean;
|
|
3837
|
+
overageInUse?: boolean;
|
|
3535
3838
|
surpassedThreshold?: number;
|
|
3536
3839
|
};
|
|
3537
3840
|
|
|
@@ -4307,6 +4610,10 @@ export declare interface Settings {
|
|
|
4307
4610
|
skillOverrides?: {
|
|
4308
4611
|
[k: string]: 'on' | 'name-only' | 'user-invocable-only' | 'off';
|
|
4309
4612
|
};
|
|
4613
|
+
/**
|
|
4614
|
+
* Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1.
|
|
4615
|
+
*/
|
|
4616
|
+
disableBundledSkills?: boolean;
|
|
4310
4617
|
/**
|
|
4311
4618
|
* Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied.
|
|
4312
4619
|
*/
|
|
@@ -5237,7 +5544,7 @@ export declare interface Settings {
|
|
|
5237
5544
|
};
|
|
5238
5545
|
})[];
|
|
5239
5546
|
/**
|
|
5240
|
-
* Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips)
|
|
5547
|
+
* Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source.
|
|
5241
5548
|
*/
|
|
5242
5549
|
pluginSuggestionMarketplaces?: string[];
|
|
5243
5550
|
/**
|
|
@@ -5466,11 +5773,11 @@ export declare interface Settings {
|
|
|
5466
5773
|
};
|
|
5467
5774
|
};
|
|
5468
5775
|
/**
|
|
5469
|
-
*
|
|
5776
|
+
* Cloud session configuration
|
|
5470
5777
|
*/
|
|
5471
5778
|
remote?: {
|
|
5472
5779
|
/**
|
|
5473
|
-
* Default environment ID to use for
|
|
5780
|
+
* Default environment ID to use for cloud sessions
|
|
5474
5781
|
*/
|
|
5475
5782
|
defaultEnvironmentId?: string;
|
|
5476
5783
|
};
|