@anthropic-ai/claude-agent-sdk 0.3.267 → 0.3.269
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.mjs +104 -104
- package/browser-sdk.js +48 -48
- package/manifest.json +50 -22
- package/manifest.zst.json +54 -26
- package/package.json +10 -10
- package/sdk-tools.d.ts +27 -8
- package/sdk.d.ts +350 -27
- package/sdk.mjs +78 -78
package/sdk.d.ts
CHANGED
|
@@ -241,6 +241,16 @@ export declare type CanUseTool = (toolName: string, input: Record<string, unknow
|
|
|
241
241
|
* read and write access to files in ~/Downloads").
|
|
242
242
|
*/
|
|
243
243
|
description?: string;
|
|
244
|
+
/**
|
|
245
|
+
* The ask must not be approvable by a single stray keystroke: open the
|
|
246
|
+
* prompt on its decline option and offer no one-key approve shortcut.
|
|
247
|
+
*/
|
|
248
|
+
defaultToNo?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* The ask must not offer a persistent "don't ask again" choice: the
|
|
251
|
+
* rule it would write grants more than this ask's own action.
|
|
252
|
+
*/
|
|
253
|
+
suppressAlwaysAllowRule?: boolean;
|
|
244
254
|
/**
|
|
245
255
|
* Unique identifier for this specific tool call within the assistant message.
|
|
246
256
|
* Multiple tool calls in the same assistant message will have different toolUseIDs.
|
|
@@ -293,11 +303,11 @@ declare type ControlErrorResponse = {
|
|
|
293
303
|
*/
|
|
294
304
|
error: string;
|
|
295
305
|
/**
|
|
296
|
-
*
|
|
306
|
+
* can_use_tool requests this CLI process has issued and not yet resolved, so a client joining an already-initialized session learns about in-flight prompts. Always present (possibly empty) on a success `initialize` response from Claude Code v2.1.268 or later; earlier versions could omit it, so treat absence as an older CLI rather than as "nothing pending". A prompt inherited from a previous worker of the same session can remain answerable without appearing here and without a control_cancel_request; session_state "requires_action" on the same reply signals one the CLI is holding, but not every inherited prompt is signalled.
|
|
297
307
|
*/
|
|
298
308
|
pending_permission_requests?: SDKControlRequest[];
|
|
299
309
|
/**
|
|
300
|
-
* request_user_dialog requests
|
|
310
|
+
* request_user_dialog requests this CLI process has issued and not yet resolved (sibling of pending_permission_requests, with the same inherited-prompt caveat), so a client joining an already-initialized session can re-arm in-flight dialogs. Always present (possibly empty) on a success `initialize` response from Claude Code v2.1.268 or later; earlier versions could omit it, so treat absence as an older CLI rather than as "nothing pending". Receivers must tolerate the same request_id also arriving as a live or replayed control_request frame and render it once.
|
|
301
311
|
*/
|
|
302
312
|
pending_user_dialog_requests?: SDKControlRequest[];
|
|
303
313
|
};
|
|
@@ -316,11 +326,11 @@ declare type ControlResponse = {
|
|
|
316
326
|
*/
|
|
317
327
|
response?: Record<string, unknown>;
|
|
318
328
|
/**
|
|
319
|
-
*
|
|
329
|
+
* can_use_tool requests this CLI process has issued and not yet resolved, so a client joining an already-initialized session learns about in-flight prompts. Always present (possibly empty) on a success `initialize` response from Claude Code v2.1.268 or later; earlier versions could omit it, so treat absence as an older CLI rather than as "nothing pending". A prompt inherited from a previous worker of the same session can remain answerable without appearing here and without a control_cancel_request; session_state "requires_action" on the same reply signals one the CLI is holding, but not every inherited prompt is signalled.
|
|
320
330
|
*/
|
|
321
331
|
pending_permission_requests?: SDKControlRequest[];
|
|
322
332
|
/**
|
|
323
|
-
* request_user_dialog requests
|
|
333
|
+
* request_user_dialog requests this CLI process has issued and not yet resolved (sibling of pending_permission_requests, with the same inherited-prompt caveat), so a client joining an already-initialized session can re-arm in-flight dialogs. Always present (possibly empty) on a success `initialize` response from Claude Code v2.1.268 or later; earlier versions could omit it, so treat absence as an older CLI rather than as "nothing pending". Receivers must tolerate the same request_id also arriving as a live or replayed control_request frame and render it once.
|
|
324
334
|
*/
|
|
325
335
|
pending_user_dialog_requests?: SDKControlRequest[];
|
|
326
336
|
};
|
|
@@ -2671,26 +2681,26 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2671
2681
|
*/
|
|
2672
2682
|
setMaxThinkingTokens(maxThinkingTokens: number | null, thinkingDisplay?: 'summarized' | 'omitted' | null): Promise<void>;
|
|
2673
2683
|
/**
|
|
2674
|
-
* Merge
|
|
2675
|
-
*
|
|
2676
|
-
*
|
|
2677
|
-
* user/project/local settings and below managed policy settings in the
|
|
2678
|
-
* precedence order.
|
|
2684
|
+
* Merge settings into the flag settings layer. This is the inline `settings`
|
|
2685
|
+
* option of `query()`, applied mid-session. Flag settings sit above
|
|
2686
|
+
* user/project/local and below managed policy settings in precedence order.
|
|
2679
2687
|
*
|
|
2680
2688
|
* Successive calls shallow-merge top-level keys — a second call with
|
|
2681
2689
|
* `{permissions: {...}}` replaces the entire `permissions` object from a
|
|
2682
2690
|
* prior call. Pass `null` for a key to clear it from the flag layer and
|
|
2683
2691
|
* fall back to lower-precedence sources (`undefined` is dropped by JSON
|
|
2684
|
-
* serialization and has no effect).
|
|
2685
|
-
*
|
|
2692
|
+
* serialization and has no effect). Four keys instead reset session state
|
|
2693
|
+
* and restore neither a `query()` option nor a settings-file value.
|
|
2694
|
+
* `effortLevel` goes to the model's default effort, `model` to Claude Code's
|
|
2695
|
+
* default model (not `ANTHROPIC_MODEL` or `settings.model`), `agent` to no
|
|
2696
|
+
* main-thread agent, and `ultracode` to off with the current effort kept.
|
|
2686
2697
|
* Only available in streaming input mode.
|
|
2687
2698
|
*
|
|
2688
|
-
* @param settings - A partial settings object to merge into the flag
|
|
2689
|
-
*
|
|
2690
|
-
*
|
|
2691
|
-
*
|
|
2692
|
-
*
|
|
2693
|
-
* {@link Settings.effortLevel} excludes it for that reason).
|
|
2699
|
+
* @param settings - A partial settings object to merge into the flag
|
|
2700
|
+
* settings. `effortLevel` also accepts `'max'` (never written to settings
|
|
2701
|
+
* files, so the persisted {@link Settings.effortLevel} excludes it): it is
|
|
2702
|
+
* session-only, runs as `'high'` on a model without `'max'` support, and
|
|
2703
|
+
* runs no higher than the organization's effort limit for the model.
|
|
2694
2704
|
*/
|
|
2695
2705
|
applyFlagSettings(settings: {
|
|
2696
2706
|
[K in keyof Settings]?: K extends 'effortLevel' ? EffortLevel | null : Settings[K] | null;
|
|
@@ -2796,6 +2806,7 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2796
2806
|
usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(opts?: {
|
|
2797
2807
|
skipBehaviors?: boolean;
|
|
2798
2808
|
}): Promise<SDKControlGetUsageResponse>;
|
|
2809
|
+
|
|
2799
2810
|
/**
|
|
2800
2811
|
* Read a file from the session's filesystem for the remote sidebar
|
|
2801
2812
|
* viewer. Path is resolved against cwd and gated by the same
|
|
@@ -2814,9 +2825,19 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2814
2825
|
* Reload plugins from disk and return the refreshed commands, agents,
|
|
2815
2826
|
* plugins, and MCP server status.
|
|
2816
2827
|
*
|
|
2817
|
-
*
|
|
2828
|
+
* With `holdOnCacheImpact`, the CLI first runs the check the interactive
|
|
2829
|
+
* /reload-plugins makes: when applying would change the session's tool
|
|
2830
|
+
* list while the conversation's prompt cache depends on it, nothing is
|
|
2831
|
+
* applied and the response carries `held: true` with `cache_impact`
|
|
2832
|
+
* describing what applying would change; call again without the option
|
|
2833
|
+
* to apply anyway.
|
|
2834
|
+
*
|
|
2835
|
+
* @returns The refreshed session components after plugin reload, or the
|
|
2836
|
+
* unchanged ones with `held: true` when the reload was held
|
|
2818
2837
|
*/
|
|
2819
|
-
reloadPlugins(
|
|
2838
|
+
reloadPlugins(options?: {
|
|
2839
|
+
holdOnCacheImpact?: boolean;
|
|
2840
|
+
}): Promise<SDKControlReloadPluginsResponse>;
|
|
2820
2841
|
/**
|
|
2821
2842
|
* Reload skills from disk and return the refreshed skill list.
|
|
2822
2843
|
*
|
|
@@ -3328,13 +3349,17 @@ export declare type SDKAssistantMessage = {
|
|
|
3328
3349
|
session_id: string;
|
|
3329
3350
|
request_id?: string;
|
|
3330
3351
|
/**
|
|
3331
|
-
* Client uuid of the user message this turn is answering (submitMessage options.uuid), stamped on
|
|
3352
|
+
* Client uuid of the user message this turn is answering (submitMessage options.uuid), stamped on an assistant message each time that send changes — the turn's FIRST top-level assistant message (which may carry only a thinking block, or be a synthetic API-error message), and then, for a turn started by a synthetic (meta) prompt, the first assistant message after each queued user message folded in mid-turn (the fold takes the echo over); with --include-partial-messages the turn's first non-ping stream event is stamped too, independently (see SDKPartialAssistantMessage), so the same uuid may appear on both — either binds the reply to the send it answers without waiting for the result; the server keeps the first stamp it sees per uuid. A turn started by a typed prompt keeps that uuid for its whole turn, so it stamps once per frame kind. A meta turn's own uuid is stamped only when the host vouches it is the client event's own (on a hosted session, the uuid the session server persisted: delivered content such as a Slack owner ping, a Slack-bot observation or a client-injected synthetic turn), never for a prompt the CLI minted itself — except that the boot-time rescue turn re-running a turn a worker restart interrupted mid-way stamps the interrupted turn's own last user prompt (with resume_reason), the send that re-run answers; either way a user message folded into a meta turn takes the echo over from it (the rescue turn absorbing messages sent while the session was down; a bot-observation turn absorbing a human's post), and the first reply frame of each kind after that fold carries the folded message's uuid — the first reply that message got. Wrapper-level sibling — never inside `message.content` — so it is not replayed to the model. Absent on every other frame of the turn, on subagent frames (parent_tool_use_id set), on turns that neither had a client uuid nor folded a user message in, and from older producers.
|
|
3332
3353
|
*/
|
|
3333
3354
|
user_message_uuid?: string;
|
|
3334
3355
|
/**
|
|
3335
3356
|
* Client uuids of every user message whose prompt this turn has consumed so far, in consumption order — all members of a prompt batch the host merged into this one turn (several messages sent close together run as one turn whose user_message_uuid is the LAST member's), then any user message folded into the turn before this frame — so a consumer that sent any of them can bind this reply to its own send by finding its uuid anywhere in the list. Always contains user_message_uuid; at most 64 entries. Present exactly when user_message_uuid is, on the same frames; absent from older producers (fall back to user_message_uuid).
|
|
3336
3357
|
*/
|
|
3337
3358
|
user_message_uuids?: string[];
|
|
3359
|
+
/**
|
|
3360
|
+
* Why this frame's turn is the automatic re-run of a turn a worker restart interrupted (CLAUDE_CODE_RESUME_INTERRUPTED_TURN): the host's CLAUDE_CODE_RESUME_REASON when it set one (host_draining, checkpoint_restore, container_recreated, …), else 'interrupted_turn'. Stamped on the same reply frames as user_message_uuid (which on such a re-run names the interrupted turn's own last user prompt), so a consumer can tell the re-run's first reply from the interrupted attempt's. Absent on every other turn, on thinking_tokens frames, and from older producers.
|
|
3361
|
+
*/
|
|
3362
|
+
resume_reason?: string;
|
|
3338
3363
|
/**
|
|
3339
3364
|
* This turn continued the preceding truncated assistant turn inside its trailing signed thinking block (max-output-tokens recovery). Its thinking signatures are cumulative over that preceding thinking-only turn, so a history replayed through the bridge must carry this flag back for the normalizer to keep the run's prefix on the wire. Wrapper-level sibling — never inside `message.content` — so it is not replayed to the model.
|
|
3340
3365
|
*/
|
|
@@ -3383,7 +3408,7 @@ export declare type SDKAssistantMessage = {
|
|
|
3383
3408
|
|
|
3384
3409
|
};
|
|
3385
3410
|
|
|
3386
|
-
export declare type SDKAssistantMessageError = 'authentication_failed' | 'oauth_org_not_allowed' | 'account_on_hold' | 'billing_error' | 'rate_limit' | 'overloaded' | 'invalid_request' | 'model_not_found' | 'server_error' | 'unknown' | 'max_output_tokens' | 'cloud_credential_error';
|
|
3411
|
+
export declare type SDKAssistantMessageError = 'authentication_failed' | 'oauth_org_not_allowed' | 'account_on_hold' | 'verification_required' | 'billing_error' | 'rate_limit' | 'overloaded' | 'invalid_request' | 'model_not_found' | 'server_error' | 'unknown' | 'max_output_tokens' | 'cloud_credential_error';
|
|
3387
3412
|
|
|
3388
3413
|
export declare type SDKAuthStatusMessage = {
|
|
3389
3414
|
type: 'auth_status';
|
|
@@ -3644,6 +3669,10 @@ export declare type SDKControlGetContextUsageResponse = {
|
|
|
3644
3669
|
tokens: number;
|
|
3645
3670
|
color: string;
|
|
3646
3671
|
isDeferred?: boolean;
|
|
3672
|
+
/**
|
|
3673
|
+
* What the row is, the same classification the /context result's context_usage rows carry: 'used' content occupies the window; 'free' is the remaining window; 'buffer' is the compaction reserve; 'deferred' rows are out-of-window tool schemas. Classify on this, never on the English name.
|
|
3674
|
+
*/
|
|
3675
|
+
kind: 'used' | 'free' | 'buffer' | 'deferred';
|
|
3647
3676
|
}[];
|
|
3648
3677
|
totalTokens: number;
|
|
3649
3678
|
maxTokens: number;
|
|
@@ -3730,6 +3759,151 @@ export declare type SDKControlGetContextUsageResponse = {
|
|
|
3730
3759
|
} | null;
|
|
3731
3760
|
};
|
|
3732
3761
|
|
|
3762
|
+
/**
|
|
3763
|
+
* Returns the hooks listing the CLI's read-only /hooks menu renders: settings-file, session, and plugin hooks grouped by event and matcher, with display-ready strings (control characters revealed) and the policy and safe-mode state the menu banners on. A snapshot at request time; hosts re-request when their surface opens.
|
|
3764
|
+
*/
|
|
3765
|
+
declare type SDKControlGetHooksListingRequest = {
|
|
3766
|
+
subtype: 'get_hooks_listing';
|
|
3767
|
+
};
|
|
3768
|
+
|
|
3769
|
+
/**
|
|
3770
|
+
* The hooks listing the CLI's /hooks menu renders, with display-ready strings.
|
|
3771
|
+
*/
|
|
3772
|
+
declare type SDKControlGetHooksListingResponse = {
|
|
3773
|
+
/**
|
|
3774
|
+
* Events that have at least one listed hook, in the /hooks menu’s lifecycle order.
|
|
3775
|
+
*/
|
|
3776
|
+
events: {
|
|
3777
|
+
/**
|
|
3778
|
+
* Hook event name.
|
|
3779
|
+
*/
|
|
3780
|
+
name: string;
|
|
3781
|
+
/**
|
|
3782
|
+
* One-line summary, as the /hooks event list shows.
|
|
3783
|
+
*/
|
|
3784
|
+
summary: string;
|
|
3785
|
+
/**
|
|
3786
|
+
* Whether hooks on this event can carry a matcher.
|
|
3787
|
+
*/
|
|
3788
|
+
supportsMatcher: boolean;
|
|
3789
|
+
/**
|
|
3790
|
+
* Number of listed hooks.
|
|
3791
|
+
*/
|
|
3792
|
+
hookCount: number;
|
|
3793
|
+
}[];
|
|
3794
|
+
/**
|
|
3795
|
+
* One row per listed hook: events in lifecycle order, matchers in the menu’s priority order.
|
|
3796
|
+
*/
|
|
3797
|
+
hooks: {
|
|
3798
|
+
event: string;
|
|
3799
|
+
/**
|
|
3800
|
+
* Matcher with control characters revealed; '' when the entry has none.
|
|
3801
|
+
*/
|
|
3802
|
+
matcher: string;
|
|
3803
|
+
/**
|
|
3804
|
+
* Raw source name (userSettings, sessionHook, pluginHook, …).
|
|
3805
|
+
*/
|
|
3806
|
+
source: string;
|
|
3807
|
+
/**
|
|
3808
|
+
* User-facing source description.
|
|
3809
|
+
*/
|
|
3810
|
+
sourceLabel: string;
|
|
3811
|
+
pluginName?: string;
|
|
3812
|
+
/**
|
|
3813
|
+
* Hook type (command, prompt, agent, http, mcp_tool, …).
|
|
3814
|
+
*/
|
|
3815
|
+
type: string;
|
|
3816
|
+
/**
|
|
3817
|
+
* List-row label: statusMessage when set, else the identity text; one line, control characters revealed.
|
|
3818
|
+
*/
|
|
3819
|
+
displayText: string;
|
|
3820
|
+
/**
|
|
3821
|
+
* Identity text — the literal command/prompt/URL that runs, control characters revealed.
|
|
3822
|
+
*/
|
|
3823
|
+
commandText: string;
|
|
3824
|
+
/**
|
|
3825
|
+
* Label for commandText (Command, Prompt, URL, …).
|
|
3826
|
+
*/
|
|
3827
|
+
contentLabel: string;
|
|
3828
|
+
/**
|
|
3829
|
+
* If-condition, revealed, when set.
|
|
3830
|
+
*/
|
|
3831
|
+
condition?: string;
|
|
3832
|
+
/**
|
|
3833
|
+
* Timeout in seconds.
|
|
3834
|
+
*/
|
|
3835
|
+
timeout?: number;
|
|
3836
|
+
statusMessage?: string;
|
|
3837
|
+
runsOnce?: boolean;
|
|
3838
|
+
runsInBackground?: boolean;
|
|
3839
|
+
/**
|
|
3840
|
+
* True when the session's mode or policy keeps this hook from running (the policy block and safeMode/bareMode say why); absent on rows that run.
|
|
3841
|
+
*/
|
|
3842
|
+
disabled?: true;
|
|
3843
|
+
/**
|
|
3844
|
+
* The entry as stored (raw matcher, '' when none, and raw hook object; no display escaping) for a host's edit form and as the target it names to `claude edit-hook`. Only on rows from a settings file this session reads and may write. HTTP header values are blanked (headersRedacted); a replace that sends no headers keeps the stored ones.
|
|
3845
|
+
*/
|
|
3846
|
+
editable?: {
|
|
3847
|
+
matcher: string;
|
|
3848
|
+
config: Record<string, unknown>;
|
|
3849
|
+
headersRedacted?: true;
|
|
3850
|
+
};
|
|
3851
|
+
}[];
|
|
3852
|
+
/**
|
|
3853
|
+
* Every hook event in lifecycle order (name, the /hooks summary, whether its hooks take a matcher), for an add-hook form.
|
|
3854
|
+
*/
|
|
3855
|
+
eventCatalog: {
|
|
3856
|
+
name: string;
|
|
3857
|
+
summary: string;
|
|
3858
|
+
supportsMatcher: boolean;
|
|
3859
|
+
}[];
|
|
3860
|
+
policy: {
|
|
3861
|
+
/**
|
|
3862
|
+
* Managed disableAllHooks — nothing runs at all.
|
|
3863
|
+
*/
|
|
3864
|
+
disabledByPolicy: boolean;
|
|
3865
|
+
/**
|
|
3866
|
+
* Managed allowManagedHooksOnly — non-managed hooks are blocked and managed hooks are intentionally not listed.
|
|
3867
|
+
*/
|
|
3868
|
+
managedOnly: boolean;
|
|
3869
|
+
/**
|
|
3870
|
+
* Managed strictPluginOnlyCustomization locks the hooks surface.
|
|
3871
|
+
*/
|
|
3872
|
+
pluginOnly: boolean;
|
|
3873
|
+
/**
|
|
3874
|
+
* Effective disableAllHooks, whatever source set it.
|
|
3875
|
+
*/
|
|
3876
|
+
allDisabled: boolean;
|
|
3877
|
+
/**
|
|
3878
|
+
* Hooks configured in managed settings (they run even under a non-managed disableAllHooks).
|
|
3879
|
+
*/
|
|
3880
|
+
policyHookCount: number;
|
|
3881
|
+
};
|
|
3882
|
+
/**
|
|
3883
|
+
* Present only when the session runs under --safe-mode.
|
|
3884
|
+
*/
|
|
3885
|
+
safeMode?: {
|
|
3886
|
+
managedHooksStillApply: boolean;
|
|
3887
|
+
/**
|
|
3888
|
+
* How to leave safe mode, per its activation source.
|
|
3889
|
+
*/
|
|
3890
|
+
exitHint: string;
|
|
3891
|
+
};
|
|
3892
|
+
/**
|
|
3893
|
+
* Present only under --bare / CLAUDE_CODE_SIMPLE with the hooks surface gated off: settings-file, flag, policy, and plugin hooks never fire there; session hooks still run.
|
|
3894
|
+
*/
|
|
3895
|
+
bareMode?: {
|
|
3896
|
+
/**
|
|
3897
|
+
* How to leave bare mode, per its activation source.
|
|
3898
|
+
*/
|
|
3899
|
+
exitHint: string;
|
|
3900
|
+
};
|
|
3901
|
+
/**
|
|
3902
|
+
* Settings files skipped by the merge — their hooks are neither listed nor running.
|
|
3903
|
+
*/
|
|
3904
|
+
errors?: coreTypes.SDKSettingsParseError[];
|
|
3905
|
+
};
|
|
3906
|
+
|
|
3733
3907
|
/**
|
|
3734
3908
|
* Requests the formatted session cost summary (the same text /usage prints in non-interactive mode). Used by the thin-client /usage dialog to show the remote container cost instead of the local $0.00.
|
|
3735
3909
|
*/
|
|
@@ -3833,7 +4007,7 @@ export declare type SDKControlGetUsageResponse = {
|
|
|
3833
4007
|
resets_at: string | null;
|
|
3834
4008
|
} | null;
|
|
3835
4009
|
/**
|
|
3836
|
-
* Per-model weekly windows from the server limits[] array, filtered by the overage-included-models allowlist. Additive
|
|
4010
|
+
* Per-model weekly windows from the server limits[] array, filtered by the overage-included-models allowlist. Additive: absent when nothing is known about them (an answer served from cached data, or rows the allowlist hides); an empty array means the endpoint itself answered and listed no per-model weekly window at all for this account, before the allowlist was applied.
|
|
3837
4011
|
*/
|
|
3838
4012
|
model_scoped?: {
|
|
3839
4013
|
/**
|
|
@@ -4054,6 +4228,7 @@ export declare type SDKControlInitializeResponse = {
|
|
|
4054
4228
|
agents: coreTypes.AgentInfo[];
|
|
4055
4229
|
output_style: string;
|
|
4056
4230
|
available_output_styles: string[];
|
|
4231
|
+
|
|
4057
4232
|
models: coreTypes.ModelInfo[];
|
|
4058
4233
|
|
|
4059
4234
|
/**
|
|
@@ -4085,6 +4260,7 @@ export declare type SDKControlInitializeResponse = {
|
|
|
4085
4260
|
|
|
4086
4261
|
|
|
4087
4262
|
|
|
4263
|
+
|
|
4088
4264
|
};
|
|
4089
4265
|
|
|
4090
4266
|
/**
|
|
@@ -4120,6 +4296,23 @@ declare type SDKControlListModelsRequest = {
|
|
|
4120
4296
|
subtype: 'list_models';
|
|
4121
4297
|
};
|
|
4122
4298
|
|
|
4299
|
+
/**
|
|
4300
|
+
* Requests the session's live permission rules and workspace directories — the same data /permissions lists in the terminal: rules from settings files plus session-only approvals, slash-command grants, and --allowedTools flag rules, each with its source.
|
|
4301
|
+
*/
|
|
4302
|
+
declare type SDKControlListPermissionRulesRequest = {
|
|
4303
|
+
subtype: 'list_permission_rules';
|
|
4304
|
+
};
|
|
4305
|
+
|
|
4306
|
+
/**
|
|
4307
|
+
* Success payload of list_permission_rules.
|
|
4308
|
+
*/
|
|
4309
|
+
export declare type SDKControlListPermissionRulesResponse = {
|
|
4310
|
+
/**
|
|
4311
|
+
* The session's live permission rules state, as list_permission_rules reports it.
|
|
4312
|
+
*/
|
|
4313
|
+
state: SDKControlPermissionRulesState;
|
|
4314
|
+
};
|
|
4315
|
+
|
|
4123
4316
|
/**
|
|
4124
4317
|
* Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. A target server that is not yet connected is brought up on demand: dispatch runs the deferred plugin/MCP startup resolution (the work a first model turn would have done) and waits up to 30s — shortened by expires_at when that is sooner — for the server to connect before answering "MCP server not connected", so a dispatch that races plugin startup (e.g. after an idle-wake reattach) succeeds instead of failing until a turn runs. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
|
|
4125
4318
|
*/
|
|
@@ -4263,6 +4456,27 @@ declare type SDKControlPermissionRequest = {
|
|
|
4263
4456
|
* True when one-tap Approve/Deny must not be offered: the tool's approval card IS the user-interaction surface (Tool.requiresUserInteraction() — the user responds on the card itself), OR the pending ask is localDisplayOnly (its consent disclosure cannot ride this wire and only the local dialog renders it). Either way the user has to open the session to answer.
|
|
4264
4457
|
*/
|
|
4265
4458
|
requires_user_interaction?: boolean;
|
|
4459
|
+
|
|
4460
|
+
};
|
|
4461
|
+
|
|
4462
|
+
/**
|
|
4463
|
+
* The session's live permission rules state, as list_permission_rules reports it.
|
|
4464
|
+
*/
|
|
4465
|
+
export declare type SDKControlPermissionRulesState = {
|
|
4466
|
+
rules: SDKPermissionRuleEntry[];
|
|
4467
|
+
workspaceDirectories: SDKPermissionWorkspaceDirectory[];
|
|
4468
|
+
/**
|
|
4469
|
+
* The session's original working directory.
|
|
4470
|
+
*/
|
|
4471
|
+
originalCwd: string;
|
|
4472
|
+
/**
|
|
4473
|
+
* True when enterprise managed settings pin allowManagedPermissionRulesOnly: the session applies policy rules only, and rules from other settings files appear with notInEffect set.
|
|
4474
|
+
*/
|
|
4475
|
+
managedOnly: boolean;
|
|
4476
|
+
/**
|
|
4477
|
+
* Settings parse and validation errors, as get_settings reports them. When non-empty, the listed files were skipped — their rules are not in the session and not listed above.
|
|
4478
|
+
*/
|
|
4479
|
+
errors?: coreTypes.SDKSettingsParseError[];
|
|
4266
4480
|
};
|
|
4267
4481
|
|
|
4268
4482
|
/**
|
|
@@ -4321,6 +4535,10 @@ export declare type SDKControlReloadOutputStylesResponse = {
|
|
|
4321
4535
|
*/
|
|
4322
4536
|
declare type SDKControlReloadPluginsRequest = {
|
|
4323
4537
|
subtype: 'reload_plugins';
|
|
4538
|
+
/**
|
|
4539
|
+
* When true, the reload is not applied if applying it would change the session's tool list while the conversation's prompt cache depends on that list (the same check the interactive /reload-plugins makes before it asks for --force): the response then carries held: true and cache_impact, and the session keeps its current plugins. Default false: apply unconditionally.
|
|
4540
|
+
*/
|
|
4541
|
+
hold_on_cache_impact?: boolean;
|
|
4324
4542
|
};
|
|
4325
4543
|
|
|
4326
4544
|
/**
|
|
@@ -4340,6 +4558,18 @@ export declare type SDKControlReloadPluginsResponse = {
|
|
|
4340
4558
|
}[];
|
|
4341
4559
|
mcpServers: coreTypes.McpServerStatus[];
|
|
4342
4560
|
error_count: number;
|
|
4561
|
+
/**
|
|
4562
|
+
* Present only when the request asked to hold on cache impact and this CLI ran the check. True: the reload was not applied, the lists above describe the session as it still is, and cache_impact says what applying would change. False: the check found no impact and the reload was applied. Absent: the request did not ask, or the CLI predates the option and applied the reload unchecked.
|
|
4563
|
+
*/
|
|
4564
|
+
held?: boolean;
|
|
4565
|
+
/**
|
|
4566
|
+
* What applying the held reload would change in the session's tool list: plugin MCP servers it would register or drop (scoped plugin:<plugin>:<server> names, plugin-authored — validate before showing) and whether it would add or remove the LSP tool (the may- forms mean the preview could not fully see the pending plugin set). Present only with held: true.
|
|
4567
|
+
*/
|
|
4568
|
+
cache_impact?: {
|
|
4569
|
+
mcp_servers_added: string[];
|
|
4570
|
+
mcp_servers_removed: string[];
|
|
4571
|
+
lsp_tool_change: ('adds' | 'may-add' | 'removes' | 'may-remove') | null;
|
|
4572
|
+
};
|
|
4343
4573
|
};
|
|
4344
4574
|
|
|
4345
4575
|
/**
|
|
@@ -4362,6 +4592,14 @@ export declare type SDKControlReloadSkillsResponse = {
|
|
|
4362
4592
|
declare type SDKControlRenameSessionRequest = {
|
|
4363
4593
|
subtype: 'rename_session';
|
|
4364
4594
|
title: string;
|
|
4595
|
+
/**
|
|
4596
|
+
* Who chose the title: 'remote' (the default) for a rename made on claude.ai and relayed to this process, 'host' for one the user made in the hosting application (an IDE), which the CLI counts as a user rename.
|
|
4597
|
+
*/
|
|
4598
|
+
source?: 'remote' | 'host';
|
|
4599
|
+
/**
|
|
4600
|
+
* The session the title is for. When given and this process has since moved to another session (/clear, an in-session resume), the request is refused instead of naming the new session.
|
|
4601
|
+
*/
|
|
4602
|
+
session_id?: string;
|
|
4365
4603
|
};
|
|
4366
4604
|
|
|
4367
4605
|
/**
|
|
@@ -4378,7 +4616,7 @@ export declare type SDKControlRequest = {
|
|
|
4378
4616
|
|
|
4379
4617
|
};
|
|
4380
4618
|
|
|
4381
|
-
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest;
|
|
4619
|
+
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlGetHooksListingRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlListPermissionRulesRequest;
|
|
4382
4620
|
|
|
4383
4621
|
/**
|
|
4384
4622
|
* Progress for a long-running client-originated control_request (currently only side_question), correlated by request_id. status 'started' means the worker accepted the request and launched the work; 'api_retry' carries the same retry counters as SDKAPIRetryMessage and is present only for that status.
|
|
@@ -4860,13 +5098,17 @@ export declare type SDKPartialAssistantMessage = {
|
|
|
4860
5098
|
session_id: string;
|
|
4861
5099
|
ttft_ms?: number;
|
|
4862
5100
|
/**
|
|
4863
|
-
* Client uuid of the user message this turn is answering (submitMessage options.uuid), stamped on a non-ping stream event each time that send changes: the turn's FIRST non-ping stream event (normally the frame that triggers the turn's initial ack), and, for a turn started by a synthetic (meta) prompt, the first non-ping stream event after each queued user message folded in mid-turn takes the echo over (see SDKAssistantMessage.user_message_uuid for the rule) — so a consumer can bind the reply stream to the send it answers without waiting for the result. A turn started by a typed prompt stamps its first non-ping stream event
|
|
5101
|
+
* Client uuid of the user message this turn is answering (submitMessage options.uuid), stamped on a non-ping stream event each time that send changes: the turn's FIRST non-ping stream event (normally the frame that triggers the turn's initial ack), and, for a turn started by a synthetic (meta) prompt, the first non-ping stream event after each queued user message folded in mid-turn takes the echo over (see SDKAssistantMessage.user_message_uuid for the rule) — so a consumer can bind the reply stream to the send it answers without waiting for the result. A turn started by a typed prompt stamps only its first non-ping stream event; independently, its first complete assistant message is stamped as well (see SDKAssistantMessage.user_message_uuid), so the same uuid may appear on both. Absent on every other stream event of the turn, on turns that neither had a client uuid nor folded a user message in, and from older producers.
|
|
4864
5102
|
*/
|
|
4865
5103
|
user_message_uuid?: string;
|
|
4866
5104
|
/**
|
|
4867
5105
|
* Client uuids of every user message whose prompt this turn has consumed so far, in consumption order — all members of a prompt batch the host merged into this one turn (several messages sent close together run as one turn whose user_message_uuid is the LAST member's), then any user message folded into the turn before this frame — so a consumer that sent any of them can bind this reply to its own send by finding its uuid anywhere in the list. Always contains user_message_uuid; at most 64 entries. Present exactly when user_message_uuid is, on the same frames; absent from older producers (fall back to user_message_uuid).
|
|
4868
5106
|
*/
|
|
4869
5107
|
user_message_uuids?: string[];
|
|
5108
|
+
/**
|
|
5109
|
+
* Why this frame's turn is the automatic re-run of a turn a worker restart interrupted (CLAUDE_CODE_RESUME_INTERRUPTED_TURN): the host's CLAUDE_CODE_RESUME_REASON when it set one (host_draining, checkpoint_restore, container_recreated, …), else 'interrupted_turn'. Stamped on the same reply frames as user_message_uuid (which on such a re-run names the interrupted turn's own last user prompt), so a consumer can tell the re-run's first reply from the interrupted attempt's. Absent on every other turn, on thinking_tokens frames, and from older producers.
|
|
5110
|
+
*/
|
|
5111
|
+
resume_reason?: string;
|
|
4870
5112
|
};
|
|
4871
5113
|
|
|
4872
5114
|
export declare type SDKPermissionDenial = {
|
|
@@ -4876,7 +5118,7 @@ export declare type SDKPermissionDenial = {
|
|
|
4876
5118
|
};
|
|
4877
5119
|
|
|
4878
5120
|
/**
|
|
4879
|
-
* Emitted when a tool call is auto-denied without an interactive permission prompt (e.g. auto-mode classifier, dontAsk mode, headless-agent auto-deny, or a deny rule). With a permission prompt surface (stdio/SDK canUseTool), the 'ask' path surfaces via a can_use_tool control_request and this event covers the 'deny' short-circuit. Without one (bare -p / SDK query() with no canUseTool), 'ask' decisions are terminal, so this event also covers those implicit denials. Best-effort advisory: in rare races a denial can book without a frame or a frame can lack a booking twin — result.permission_denials is the authoritative record. Denials that resolve before canUseTool runs — PreToolUse hook denies,
|
|
5121
|
+
* Emitted when a tool call is auto-denied without an interactive permission prompt (e.g. auto-mode classifier, dontAsk mode, headless-agent auto-deny, or a deny rule). With a permission prompt surface (stdio/SDK canUseTool), the 'ask' path surfaces via a can_use_tool control_request and this event covers the 'deny' short-circuit. Without one (bare -p / SDK query() with no canUseTool), 'ask' decisions are terminal, so this event also covers those implicit denials. Best-effort advisory: in rare races a denial can book without a frame or a frame can lack a booking twin — result.permission_denials is the authoritative record. Denials that resolve before canUseTool runs — PreToolUse hook denies, deny-rule overrides of hook allow/ask decisions, and file-tool calls (Read, Edit, Write) refused by a path-scoped deny rule — are not covered here, and neither is the MCP --permission-prompt-tool surface (the prompt tool is the host there).
|
|
4880
5122
|
*/
|
|
4881
5123
|
export declare type SDKPermissionDeniedMessage = {
|
|
4882
5124
|
type: 'system';
|
|
@@ -4903,6 +5145,53 @@ export declare type SDKPermissionDeniedMessage = {
|
|
|
4903
5145
|
session_id: string;
|
|
4904
5146
|
};
|
|
4905
5147
|
|
|
5148
|
+
/**
|
|
5149
|
+
* The CLI's plain-language reading of a rule (e.g. "Any Bash command starting with npm run"), split into parts so hosts can render the rule-derived fragment the way the terminal does (bold). prefix and suffix are fixed words; emphasis is rule content — apply display hygiene (invisible-character escaping) before rendering it.
|
|
5150
|
+
*/
|
|
5151
|
+
export declare type SDKPermissionRuleDescription = {
|
|
5152
|
+
prefix: string;
|
|
5153
|
+
emphasis?: string;
|
|
5154
|
+
suffix?: string;
|
|
5155
|
+
};
|
|
5156
|
+
|
|
5157
|
+
/**
|
|
5158
|
+
* One permission rule with its provenance and where it lives.
|
|
5159
|
+
*/
|
|
5160
|
+
export declare type SDKPermissionRuleEntry = {
|
|
5161
|
+
behavior: 'allow' | 'deny' | 'ask';
|
|
5162
|
+
/**
|
|
5163
|
+
* Where the rule comes from. Mirrors PermissionRuleSource (permissionRuleLookup.ts PERMISSION_RULE_SOURCES); the parity test in test/cli/headlessControl/listPermissionRules.test.ts keeps the two aligned.
|
|
5164
|
+
*/
|
|
5165
|
+
source: 'userSettings' | 'projectSettings' | 'localSettings' | 'flagSettings' | 'policySettings' | 'cliArg' | 'command' | 'session' | 'toolsNarrowing' | 'mcpServerPolicy' | 'hostCredential';
|
|
5166
|
+
/**
|
|
5167
|
+
* The stored rule string VERBATIM, exactly as the session holds it. Two stored spellings that parse identically each get their own entry. Can carry invisible or control characters by design — escape at display.
|
|
5168
|
+
*/
|
|
5169
|
+
rule: string;
|
|
5170
|
+
/**
|
|
5171
|
+
* Plain-language reading of the rule; absent where the terminal shows no subtitle either.
|
|
5172
|
+
*/
|
|
5173
|
+
description?: SDKPermissionRuleDescription;
|
|
5174
|
+
/**
|
|
5175
|
+
* Where the rule lives: 'persistent' (userSettings/projectSettings/localSettings — saved in a settings file), 'session' (cliArg/session — in memory only, for the rest of this session), or 'readonly' (policySettings/flagSettings/command and every other source — the set the terminal's /permissions treats as read-only). Informational for hosts; this request never changes rules.
|
|
5176
|
+
*/
|
|
5177
|
+
editability: 'persistent' | 'session' | 'readonly';
|
|
5178
|
+
/**
|
|
5179
|
+
* Present (true) when enterprise managed settings pin allowManagedPermissionRulesOnly and this rule, read from a non-policy settings file, is ignored by the session. Such rows are readonly.
|
|
5180
|
+
*/
|
|
5181
|
+
notInEffect?: boolean;
|
|
5182
|
+
};
|
|
5183
|
+
|
|
5184
|
+
/**
|
|
5185
|
+
* One additional working directory in the permission scope.
|
|
5186
|
+
*/
|
|
5187
|
+
export declare type SDKPermissionWorkspaceDirectory = {
|
|
5188
|
+
path: string;
|
|
5189
|
+
/**
|
|
5190
|
+
* Where the directory grant came from: a settings source (e.g. 'localSettings'), 'cliArg' (--add-dir), or 'session' (/add-dir, IDE workspace folders).
|
|
5191
|
+
*/
|
|
5192
|
+
source: string;
|
|
5193
|
+
};
|
|
5194
|
+
|
|
4906
5195
|
/**
|
|
4907
5196
|
* Configuration for loading a plugin.
|
|
4908
5197
|
*/
|
|
@@ -4975,6 +5264,10 @@ export declare type SDKRateLimitInfo = {
|
|
|
4975
5264
|
|
|
4976
5265
|
|
|
4977
5266
|
|
|
5267
|
+
/**
|
|
5268
|
+
* Which spend limit blocked the request when it is not the member's own cap: 'group_pool' means a pooled group budget shared by the member's team is used up (the denial otherwise looks like the member's own monthly cap). Absent on a plain member denial and from older CLIs.
|
|
5269
|
+
*/
|
|
5270
|
+
limitScope?: 'service' | 'channel' | 'group_pool';
|
|
4978
5271
|
errorCode?: 'credits_required';
|
|
4979
5272
|
canUserPurchaseCredits?: boolean;
|
|
4980
5273
|
hasChargeableSavedPaymentMethod?: boolean;
|
|
@@ -5016,7 +5309,15 @@ export declare type SDKResultError = {
|
|
|
5016
5309
|
* Client uuids of every user message whose prompt this turn consumed, in consumption order — all members of a prompt batch the host merged into this one turn (several messages sent close together run as one turn whose user_message_uuid is the LAST member's), then any queued user message folded into the running turn between tool rounds, once taken off the queue — so a consumer that sent any of them can bind this result to its own send by finding its uuid anywhere in the list. Always contains user_message_uuid; at most 64 entries; can be longer than the list on the turn's first reply frame. Present when a headless turn that ran echoes user_message_uuid; absent on delivery-failure and zeroed results and from older producers (fall back to user_message_uuid).
|
|
5017
5310
|
*/
|
|
5018
5311
|
user_message_uuids?: string[];
|
|
5312
|
+
/**
|
|
5313
|
+
* Why this turn was the automatic re-run of a turn a worker restart interrupted (CLAUDE_CODE_RESUME_INTERRUPTED_TURN): the host's CLAUDE_CODE_RESUME_REASON when it set one (host_draining, checkpoint_restore, container_recreated, …), else 'interrupted_turn'. Present on a headless re-run's result, success or error, with or without an echo (a re-run whose opener could not be vouched still carries the reason); absent on every other turn, on the Remote Control bridge's per-turn synthetic results, and from older producers.
|
|
5314
|
+
*/
|
|
5315
|
+
resume_reason?: string;
|
|
5019
5316
|
terminal_reason?: TerminalReason;
|
|
5317
|
+
/**
|
|
5318
|
+
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
5319
|
+
*/
|
|
5320
|
+
result_index?: number;
|
|
5020
5321
|
fast_mode_state?: FastModeState;
|
|
5021
5322
|
fast_mode_disabled_reason?: FastModeDisabledReason;
|
|
5022
5323
|
origin?: SDKMessageOrigin;
|
|
@@ -5039,6 +5340,8 @@ export declare type SDKResultSuccess = {
|
|
|
5039
5340
|
time_to_request_ms?: number;
|
|
5040
5341
|
user_message_uuid?: string;
|
|
5041
5342
|
user_message_uuids?: string[];
|
|
5343
|
+
resume_reason?: string;
|
|
5344
|
+
local_command?: string;
|
|
5042
5345
|
request_sent_wall_ms?: number;
|
|
5043
5346
|
first_content_frame_ms?: number;
|
|
5044
5347
|
first_stream_post_ms?: number;
|
|
@@ -5073,6 +5376,10 @@ export declare type SDKResultSuccess = {
|
|
|
5073
5376
|
structured_output?: unknown;
|
|
5074
5377
|
deferred_tool_use?: SDKDeferredToolUse;
|
|
5075
5378
|
terminal_reason?: TerminalReason;
|
|
5379
|
+
/**
|
|
5380
|
+
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
5381
|
+
*/
|
|
5382
|
+
result_index?: number;
|
|
5076
5383
|
fast_mode_state?: FastModeState;
|
|
5077
5384
|
fast_mode_disabled_reason?: FastModeDisabledReason;
|
|
5078
5385
|
origin?: SDKMessageOrigin;
|
|
@@ -6369,6 +6676,10 @@ export declare interface Settings {
|
|
|
6369
6676
|
* Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).
|
|
6370
6677
|
*/
|
|
6371
6678
|
defaultShell?: 'bash' | 'powershell';
|
|
6679
|
+
/**
|
|
6680
|
+
* Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: on when the Bash tool handles file edits. Only user, flag or policy settings can turn it on outside auto and bypassPermissions modes.
|
|
6681
|
+
*/
|
|
6682
|
+
bashEditDiffEnabled?: boolean;
|
|
6372
6683
|
/**
|
|
6373
6684
|
* How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window.
|
|
6374
6685
|
*/
|
|
@@ -6472,7 +6783,14 @@ export declare interface Settings {
|
|
|
6472
6783
|
[k: string]: unknown;
|
|
6473
6784
|
};
|
|
6474
6785
|
};
|
|
6475
|
-
|
|
6786
|
+
/**
|
|
6787
|
+
* Managed plugins (plugin\@marketplace ids that managed enabledPlugins sets true) whose hooks run first, outermost, in the listed order: the first id listed sees every event before any other plugin and every result after it. Managed plugins not listed here or in appendPlugins follow the listed ones; user, project and marketplace plugins come after those; then appendPlugins; then the built-in plugins. The bundled sec-default\@builtin seats itself outermost (on a machine with managed settings and for Team and Enterprise organizations) unless this list is set, in which case list sec-default\@builtin where it should sit or leave it out. Any other id that is not an enabled managed plugin is skipped; an id listed in both keys is prepended. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources.
|
|
6788
|
+
*/
|
|
6789
|
+
prependPlugins?: string[];
|
|
6790
|
+
/**
|
|
6791
|
+
* Managed plugins (plugin\@marketplace ids that managed enabledPlugins sets true) whose hooks run last among plugins, innermost, in the listed order: the last id listed sits just above the built-in plugins and sees each event as every other plugin left it. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources.
|
|
6792
|
+
*/
|
|
6793
|
+
appendPlugins?: string[];
|
|
6476
6794
|
/**
|
|
6477
6795
|
* Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources.
|
|
6478
6796
|
*/
|
|
@@ -7668,12 +7986,16 @@ export declare interface Settings {
|
|
|
7668
7986
|
* Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: "gateway". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.
|
|
7669
7987
|
*/
|
|
7670
7988
|
forceLoginGatewayUrl?: string;
|
|
7989
|
+
/**
|
|
7990
|
+
* IPv4 CIDR blocks (at most 4, each /8 to /32, not overlapping) your Cloud gateway sits in: the public block your organization numbers its internal network from, which lets /login reach a gateway there. A block must lie entirely outside private space, where /login accepts a gateway without this key. /login accepts a gateway inside a listed block over a direct connection only, and only when this machine's own address on that connection is inside the same block, so /login must happen from a machine whose own address is inside the block (not through a proxy, VPN pool, container or NAT segment outside it). A bar against copied settings files, not proof of location. Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.
|
|
7991
|
+
*/
|
|
7992
|
+
gatewayInternalNetworks?: string[];
|
|
7671
7993
|
/**
|
|
7672
7994
|
* Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped — admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).
|
|
7673
7995
|
*/
|
|
7674
7996
|
parentSettingsBehavior?: 'first-wins' | 'merge';
|
|
7675
7997
|
/**
|
|
7676
|
-
* Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed precedence server-managed > MDM > managed-settings.json — scalars take the highest source's value (a restrictive boolean or enum — the allowManaged*Only locks, the disable* switches, the sandbox lock family — takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod and
|
|
7998
|
+
* Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed precedence server-managed > MDM > managed-settings.json — scalars take the highest source's value (a restrictive boolean or enum — the allowManaged*Only locks, the disable* switches, the sandbox lock family — takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge.
|
|
7677
7999
|
*/
|
|
7678
8000
|
managedSourcesBehavior?: 'first-wins' | 'merge';
|
|
7679
8001
|
/**
|
|
@@ -8697,6 +9019,7 @@ export declare type ToolConfig = {
|
|
|
8697
9019
|
*/
|
|
8698
9020
|
previewFormat?: 'markdown' | 'html';
|
|
8699
9021
|
|
|
9022
|
+
|
|
8700
9023
|
};
|
|
8701
9024
|
};
|
|
8702
9025
|
|