@anthropic-ai/claude-agent-sdk 0.2.116 → 0.2.118
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 -88
- package/bridge.mjs +59 -59
- package/browser-sdk.js +22 -22
- package/manifest.json +19 -19
- package/manifest.zst.json +23 -23
- package/package.json +10 -10
- package/sdk-tools.d.ts +0 -21
- package/sdk.d.ts +192 -48
- package/sdk.mjs +43 -43
package/manifest.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"commit": "
|
|
4
|
-
"buildDate": "2026-04-
|
|
2
|
+
"version": "2.1.118",
|
|
3
|
+
"commit": "ef88b5f0a79aac989f53fd18178939a54a48624a",
|
|
4
|
+
"buildDate": "2026-04-22T22:43:30Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "54e5d3f65109b89c6046f47440944d52906c662d1e51748f620a430d26ad3665",
|
|
9
|
+
"size": 207690848
|
|
10
10
|
},
|
|
11
11
|
"darwin-x64": {
|
|
12
12
|
"binary": "claude",
|
|
13
|
-
"checksum": "
|
|
14
|
-
"size":
|
|
13
|
+
"checksum": "2cd554070f0588de05e9efd88c1f073770cb620ed3e5f45ba7df833fc3414c1b",
|
|
14
|
+
"size": 209238608
|
|
15
15
|
},
|
|
16
16
|
"linux-arm64": {
|
|
17
17
|
"binary": "claude",
|
|
18
|
-
"checksum": "
|
|
19
|
-
"size":
|
|
18
|
+
"checksum": "b77b22fe93c15409f3c64be67950fe11e5fc17d1cd327891596cb87dd9be0492",
|
|
19
|
+
"size": 239798848
|
|
20
20
|
},
|
|
21
21
|
"linux-x64": {
|
|
22
22
|
"binary": "claude",
|
|
23
|
-
"checksum": "
|
|
24
|
-
"size":
|
|
23
|
+
"checksum": "ba363b2410a47120d2d4b8ece2e11fe0bbc5d59adb1329e8fb87ea0f370f4e46",
|
|
24
|
+
"size": 239573632
|
|
25
25
|
},
|
|
26
26
|
"linux-arm64-musl": {
|
|
27
27
|
"binary": "claude",
|
|
28
|
-
"checksum": "
|
|
29
|
-
"size":
|
|
28
|
+
"checksum": "dcb27938ed10b7da586b6f7ba0dde768980b5e3d38b258c1f4e9a94e7b3dd6d2",
|
|
29
|
+
"size": 232524224
|
|
30
30
|
},
|
|
31
31
|
"linux-x64-musl": {
|
|
32
32
|
"binary": "claude",
|
|
33
|
-
"checksum": "
|
|
34
|
-
"size":
|
|
33
|
+
"checksum": "bd05142de3e3ead48313d4215577c9a9c89f05ca286d771cdff025544c52ae29",
|
|
34
|
+
"size": 233839040
|
|
35
35
|
},
|
|
36
36
|
"win32-x64": {
|
|
37
37
|
"binary": "claude.exe",
|
|
38
|
-
"checksum": "
|
|
39
|
-
"size":
|
|
38
|
+
"checksum": "5a05b03b880de26bb78fb9824bacf08e99dcf05c02e3c66546cccaf2f2930b2e",
|
|
39
|
+
"size": 249035936
|
|
40
40
|
},
|
|
41
41
|
"win32-arm64": {
|
|
42
42
|
"binary": "claude.exe",
|
|
43
|
-
"checksum": "
|
|
44
|
-
"size":
|
|
43
|
+
"checksum": "b3d8942b49f672ef2e1394e004f0f53e197caefe30890620b6974a3e8dba63ec",
|
|
44
|
+
"size": 245760672
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
package/manifest.zst.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"commit": "
|
|
4
|
-
"buildDate": "2026-04-
|
|
2
|
+
"version": "2.1.118",
|
|
3
|
+
"commit": "ef88b5f0a79aac989f53fd18178939a54a48624a",
|
|
4
|
+
"buildDate": "2026-04-22T22:50:17Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude.zst",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "0895347a08fe909e1761d0b73e18cdc8b4c0ad63d159bf422c8e3d49234a3b97",
|
|
9
|
+
"size": 43098168,
|
|
10
10
|
"bundle": {
|
|
11
|
-
"checksum": "
|
|
12
|
-
"size":
|
|
11
|
+
"checksum": "10c7965cd61422b4f81cf2a9b08f023a38e4b24240e0373313ddf2596882db69",
|
|
12
|
+
"size": 43107336
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"darwin-x64": {
|
|
16
16
|
"binary": "claude.zst",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "b0537677a5aaa0d3e85f44ee6f14e984c6cdf0cf8fe9e2f883067586d591337e",
|
|
18
|
+
"size": 44811420,
|
|
19
19
|
"bundle": {
|
|
20
|
-
"checksum": "
|
|
21
|
-
"size":
|
|
20
|
+
"checksum": "6ac33e23fea2e737a7664ae4e73569e8f21fb08e6f01e4d079eede44116011fb",
|
|
21
|
+
"size": 44810879
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"linux-arm64": {
|
|
25
25
|
"binary": "claude.zst",
|
|
26
|
-
"checksum": "
|
|
27
|
-
"size":
|
|
26
|
+
"checksum": "7eb45089b179a0688de458ccbb0df8c33eacc2183808a8a54d50cee8ea928597",
|
|
27
|
+
"size": 52732492
|
|
28
28
|
},
|
|
29
29
|
"linux-x64": {
|
|
30
30
|
"binary": "claude.zst",
|
|
31
|
-
"checksum": "
|
|
32
|
-
"size":
|
|
31
|
+
"checksum": "063d156f8028c20ab84d7ff9188f6ca187920fa8dcca48d1b4d2dd2b831d11cb",
|
|
32
|
+
"size": 53288756
|
|
33
33
|
},
|
|
34
34
|
"linux-arm64-musl": {
|
|
35
35
|
"binary": "claude.zst",
|
|
36
|
-
"checksum": "
|
|
37
|
-
"size":
|
|
36
|
+
"checksum": "3b46a777475682fbfbdfd6ac70e71e627fd9ceb6cd53d71b0ec05e1d8a4be8e3",
|
|
37
|
+
"size": 51352015
|
|
38
38
|
},
|
|
39
39
|
"linux-x64-musl": {
|
|
40
40
|
"binary": "claude.zst",
|
|
41
|
-
"checksum": "
|
|
42
|
-
"size":
|
|
41
|
+
"checksum": "8c45470b73bf2016db60bc0200bc78021adccbd05b0ad266547ac41aad74cd1f",
|
|
42
|
+
"size": 51983350
|
|
43
43
|
},
|
|
44
44
|
"win32-x64": {
|
|
45
45
|
"binary": "claude.exe.zst",
|
|
46
|
-
"checksum": "
|
|
47
|
-
"size":
|
|
46
|
+
"checksum": "5ef7753a8aa0ca80f951acc832bde5da46731751fb4f7b9193fb24099823f26a",
|
|
47
|
+
"size": 54917824
|
|
48
48
|
},
|
|
49
49
|
"win32-arm64": {
|
|
50
50
|
"binary": "claude.exe.zst",
|
|
51
|
-
"checksum": "
|
|
52
|
-
"size":
|
|
51
|
+
"checksum": "af53cf487f65fc168964deb3ed26105965ad78433b438d51e7bbf7b8054c636b",
|
|
52
|
+
"size": 53057220
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropic-ai/claude-agent-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.118",
|
|
4
4
|
"main": "sdk.mjs",
|
|
5
5
|
"types": "sdk.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"zod": "^4.0.0"
|
|
56
56
|
},
|
|
57
57
|
"optionalDependencies": {
|
|
58
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.2.
|
|
59
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.2.
|
|
60
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.2.
|
|
61
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.2.
|
|
62
|
-
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.2.
|
|
63
|
-
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.2.
|
|
64
|
-
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.2.
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.2.
|
|
58
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.2.118",
|
|
59
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.2.118",
|
|
60
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.2.118",
|
|
61
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.2.118",
|
|
62
|
+
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.2.118",
|
|
63
|
+
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.2.118",
|
|
64
|
+
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.2.118",
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.2.118"
|
|
66
66
|
},
|
|
67
67
|
"files": [
|
|
68
68
|
"sdk.mjs",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"manifest.json",
|
|
79
79
|
"manifest.zst.json"
|
|
80
80
|
],
|
|
81
|
-
"claudeCodeVersion": "2.1.
|
|
81
|
+
"claudeCodeVersion": "2.1.118"
|
|
82
82
|
}
|
package/sdk-tools.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ export type ToolInputSchemas =
|
|
|
27
27
|
| WebFetchInput
|
|
28
28
|
| WebSearchInput
|
|
29
29
|
| AskUserQuestionInput
|
|
30
|
-
| ConfigInput
|
|
31
30
|
| EnterWorktreeInput
|
|
32
31
|
| ExitWorktreeInput
|
|
33
32
|
| ToolOutputSchemas;
|
|
@@ -49,7 +48,6 @@ export type ToolOutputSchemas =
|
|
|
49
48
|
| WebFetchOutput
|
|
50
49
|
| WebSearchOutput
|
|
51
50
|
| AskUserQuestionOutput
|
|
52
|
-
| ConfigOutput
|
|
53
51
|
| EnterWorktreeOutput
|
|
54
52
|
| ExitWorktreeOutput;
|
|
55
53
|
export type AgentOutput =
|
|
@@ -2140,16 +2138,6 @@ export interface AskUserQuestionInput {
|
|
|
2140
2138
|
source?: string;
|
|
2141
2139
|
};
|
|
2142
2140
|
}
|
|
2143
|
-
export interface ConfigInput {
|
|
2144
|
-
/**
|
|
2145
|
-
* The setting key (e.g., "theme", "model", "permissions.defaultMode")
|
|
2146
|
-
*/
|
|
2147
|
-
setting: string;
|
|
2148
|
-
/**
|
|
2149
|
-
* The new value. Omit to get current value.
|
|
2150
|
-
*/
|
|
2151
|
-
value?: string | boolean | number;
|
|
2152
|
-
}
|
|
2153
2141
|
export interface EnterWorktreeInput {
|
|
2154
2142
|
/**
|
|
2155
2143
|
* Optional name for a new worktree. Each "/"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided. Mutually exclusive with `path`.
|
|
@@ -2718,15 +2706,6 @@ export interface AskUserQuestionOutput {
|
|
|
2718
2706
|
};
|
|
2719
2707
|
};
|
|
2720
2708
|
}
|
|
2721
|
-
export interface ConfigOutput {
|
|
2722
|
-
success: boolean;
|
|
2723
|
-
operation?: "get" | "set";
|
|
2724
|
-
setting?: string;
|
|
2725
|
-
value?: unknown;
|
|
2726
|
-
previousValue?: unknown;
|
|
2727
|
-
newValue?: unknown;
|
|
2728
|
-
error?: string;
|
|
2729
|
-
}
|
|
2730
2709
|
export interface EnterWorktreeOutput {
|
|
2731
2710
|
worktreePath: string;
|
|
2732
2711
|
worktreeBranch?: string;
|
package/sdk.d.ts
CHANGED
|
@@ -325,6 +325,9 @@ declare namespace coreTypes {
|
|
|
325
325
|
PermissionUpdateDestination,
|
|
326
326
|
PermissionUpdate,
|
|
327
327
|
PostCompactHookInput,
|
|
328
|
+
PostToolBatchHookInput,
|
|
329
|
+
PostToolBatchHookSpecificOutput,
|
|
330
|
+
PostToolBatchToolCall,
|
|
328
331
|
PostToolUseFailureHookInput,
|
|
329
332
|
PostToolUseFailureHookSpecificOutput,
|
|
330
333
|
PostToolUseHookInput,
|
|
@@ -554,6 +557,29 @@ export declare type FileChangedHookSpecificOutput = {
|
|
|
554
557
|
watchPaths?: string[];
|
|
555
558
|
};
|
|
556
559
|
|
|
560
|
+
/**
|
|
561
|
+
* Fold a batch of appended entries into the running summary for `key`.
|
|
562
|
+
*
|
|
563
|
+
* Stores call this from inside `append()` to keep a {@link SessionSummaryEntry}
|
|
564
|
+
* sidecar up to date without re-reading the transcript. `prev` is the previous
|
|
565
|
+
* summary for the same key (or `undefined` for the first append). The returned
|
|
566
|
+
* `data` blob is opaque to the store — persist it verbatim.
|
|
567
|
+
*
|
|
568
|
+
* Set-once fields (`isSidechain`, `createdAt`, `cwd`, `firstPrompt`) freeze on
|
|
569
|
+
* first sight; last-wins fields (`customTitle`, `aiTitle`, `lastPrompt`,
|
|
570
|
+
* `summaryHint`, `gitBranch`, `tag`) overwrite on every appearance.
|
|
571
|
+
*
|
|
572
|
+
* `mtime` is NOT derived from entry timestamps — the adapter MUST stamp it at
|
|
573
|
+
* persist time using the same clock it uses for `listSessions().mtime`. Pass
|
|
574
|
+
* it via `options.mtime`; when omitted, the previous summary's `mtime` is
|
|
575
|
+
* preserved (use this only when re-folding the same sidecar without a new
|
|
576
|
+
* persist). See {@link SessionSummaryEntry.mtime} for the contract.
|
|
577
|
+
* @alpha
|
|
578
|
+
*/
|
|
579
|
+
export declare function foldSessionSummary(prev: SessionSummaryEntry | undefined, key: SessionKey, entries: SessionStoreEntry[], options?: {
|
|
580
|
+
mtime?: number;
|
|
581
|
+
}): SessionSummaryEntry;
|
|
582
|
+
|
|
557
583
|
/**
|
|
558
584
|
* Fork a session into a new branch with fresh UUIDs.
|
|
559
585
|
*
|
|
@@ -684,7 +710,7 @@ export declare type GetSubagentMessagesOptions = {
|
|
|
684
710
|
sessionStore?: SessionStore;
|
|
685
711
|
};
|
|
686
712
|
|
|
687
|
-
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "Notification", "UserPromptSubmit", "UserPromptExpansion", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged"];
|
|
713
|
+
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "UserPromptSubmit", "UserPromptExpansion", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged"];
|
|
688
714
|
|
|
689
715
|
/**
|
|
690
716
|
* Hook callback function for responding to events during execution.
|
|
@@ -703,9 +729,9 @@ export declare interface HookCallbackMatcher {
|
|
|
703
729
|
timeout?: number;
|
|
704
730
|
}
|
|
705
731
|
|
|
706
|
-
export declare type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'Notification' | 'UserPromptSubmit' | 'UserPromptExpansion' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'StopFailure' | 'SubagentStart' | 'SubagentStop' | 'PreCompact' | 'PostCompact' | 'PermissionRequest' | 'PermissionDenied' | 'Setup' | 'TeammateIdle' | 'TaskCreated' | 'TaskCompleted' | 'Elicitation' | 'ElicitationResult' | 'ConfigChange' | 'WorktreeCreate' | 'WorktreeRemove' | 'InstructionsLoaded' | 'CwdChanged' | 'FileChanged';
|
|
732
|
+
export declare type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'PostToolBatch' | 'Notification' | 'UserPromptSubmit' | 'UserPromptExpansion' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'StopFailure' | 'SubagentStart' | 'SubagentStop' | 'PreCompact' | 'PostCompact' | 'PermissionRequest' | 'PermissionDenied' | 'Setup' | 'TeammateIdle' | 'TaskCreated' | 'TaskCompleted' | 'Elicitation' | 'ElicitationResult' | 'ConfigChange' | 'WorktreeCreate' | 'WorktreeRemove' | 'InstructionsLoaded' | 'CwdChanged' | 'FileChanged';
|
|
707
733
|
|
|
708
|
-
export declare type HookInput = PreToolUseHookInput | PostToolUseHookInput | PostToolUseFailureHookInput | PermissionDeniedHookInput | NotificationHookInput | UserPromptSubmitHookInput | UserPromptExpansionHookInput | SessionStartHookInput | SessionEndHookInput | StopHookInput | StopFailureHookInput | SubagentStartHookInput | SubagentStopHookInput | PreCompactHookInput | PostCompactHookInput | PermissionRequestHookInput | SetupHookInput | TeammateIdleHookInput | TaskCreatedHookInput | TaskCompletedHookInput | ElicitationHookInput | ElicitationResultHookInput | ConfigChangeHookInput | InstructionsLoadedHookInput | WorktreeCreateHookInput | WorktreeRemoveHookInput | CwdChangedHookInput | FileChangedHookInput;
|
|
734
|
+
export declare type HookInput = PreToolUseHookInput | PostToolUseHookInput | PostToolUseFailureHookInput | PostToolBatchHookInput | PermissionDeniedHookInput | NotificationHookInput | UserPromptSubmitHookInput | UserPromptExpansionHookInput | SessionStartHookInput | SessionEndHookInput | StopHookInput | StopFailureHookInput | SubagentStartHookInput | SubagentStopHookInput | PreCompactHookInput | PostCompactHookInput | PermissionRequestHookInput | SetupHookInput | TeammateIdleHookInput | TaskCreatedHookInput | TaskCompletedHookInput | ElicitationHookInput | ElicitationResultHookInput | ConfigChangeHookInput | InstructionsLoadedHookInput | WorktreeCreateHookInput | WorktreeRemoveHookInput | CwdChangedHookInput | FileChangedHookInput;
|
|
709
735
|
|
|
710
736
|
export declare type HookJSONOutput = AsyncHookJSONOutput | SyncHookJSONOutput;
|
|
711
737
|
|
|
@@ -774,6 +800,8 @@ export declare type InferShape<T extends AnyZodRawShape> = {
|
|
|
774
800
|
export declare class InMemorySessionStore implements SessionStore {
|
|
775
801
|
private store;
|
|
776
802
|
private mtimes;
|
|
803
|
+
private summaries;
|
|
804
|
+
private lastMtime;
|
|
777
805
|
private keyToString;
|
|
778
806
|
append(key: SessionKey, entries: SessionStoreEntry[]): Promise<void>;
|
|
779
807
|
load(key: SessionKey): Promise<SessionStoreEntry[] | null>;
|
|
@@ -781,6 +809,7 @@ export declare class InMemorySessionStore implements SessionStore {
|
|
|
781
809
|
sessionId: string;
|
|
782
810
|
mtime: number;
|
|
783
811
|
}>>;
|
|
812
|
+
listSessionSummaries(projectKey: string): Promise<SessionSummaryEntry[]>;
|
|
784
813
|
delete(key: SessionKey): Promise<void>;
|
|
785
814
|
listSubkeys(key: {
|
|
786
815
|
projectKey: string;
|
|
@@ -1415,6 +1444,13 @@ export declare type Options = {
|
|
|
1415
1444
|
* - `'dontAsk'` - Don't prompt for permissions, deny if not pre-approved
|
|
1416
1445
|
*/
|
|
1417
1446
|
permissionMode?: PermissionMode;
|
|
1447
|
+
/**
|
|
1448
|
+
* Custom workflow instructions for plan mode. When `permissionMode` is
|
|
1449
|
+
* `'plan'`, this string replaces the default code-implementation workflow
|
|
1450
|
+
* body in the plan-mode system reminder. The CLI still wraps it with the
|
|
1451
|
+
* read-only enforcement preamble and the ExitPlanMode protocol footer.
|
|
1452
|
+
*/
|
|
1453
|
+
planModeInstructions?: string;
|
|
1418
1454
|
/**
|
|
1419
1455
|
* Must be set to `true` when using `permissionMode: 'bypassPermissions'`.
|
|
1420
1456
|
* This is a safety measure to ensure intentional bypassing of permissions.
|
|
@@ -1542,6 +1578,28 @@ export declare type Options = {
|
|
|
1542
1578
|
* ```
|
|
1543
1579
|
*/
|
|
1544
1580
|
settings?: string | Settings;
|
|
1581
|
+
/**
|
|
1582
|
+
* Policy-tier settings supplied by the spawning parent process. Merged into
|
|
1583
|
+
* the managed-settings layer below IT-controlled sources (server / MDM /
|
|
1584
|
+
* managed-settings.json) but above HKCU. Honors policy-only keys such as
|
|
1585
|
+
* `sandbox.network.allowManagedDomainsOnly`.
|
|
1586
|
+
*
|
|
1587
|
+
* Intended for embedding applications (e.g. desktop apps) that derive
|
|
1588
|
+
* lockdown settings from their own enterprise configuration and need to
|
|
1589
|
+
* enforce them on the spawned subprocess without writing root-owned files.
|
|
1590
|
+
*
|
|
1591
|
+
* Unlike `settings`, this option is loaded into the managed (policy) layer
|
|
1592
|
+
* rather than the user-controlled flag layer, so user/project settings
|
|
1593
|
+
* cannot widen restrictions set here.
|
|
1594
|
+
*
|
|
1595
|
+
* @example
|
|
1596
|
+
* ```typescript
|
|
1597
|
+
* managedSettings: {
|
|
1598
|
+
* sandbox: { network: { allowManagedDomainsOnly: true } }
|
|
1599
|
+
* }
|
|
1600
|
+
* ```
|
|
1601
|
+
*/
|
|
1602
|
+
managedSettings?: Settings;
|
|
1545
1603
|
/**
|
|
1546
1604
|
* Control which filesystem settings to load.
|
|
1547
1605
|
* - `'user'` - Global user settings (`~/.claude/settings.json`)
|
|
@@ -1775,6 +1833,26 @@ export declare type PostCompactHookInput = BaseHookInput & {
|
|
|
1775
1833
|
compact_summary: string;
|
|
1776
1834
|
};
|
|
1777
1835
|
|
|
1836
|
+
/**
|
|
1837
|
+
* Hook input for the PostToolBatch event. Fired once after every tool call in a batch has resolved, before the next model request. PostToolUse fires per-tool and may run concurrently for parallel tool calls; PostToolBatch fires exactly once with the full batch.
|
|
1838
|
+
*/
|
|
1839
|
+
export declare type PostToolBatchHookInput = BaseHookInput & {
|
|
1840
|
+
hook_event_name: 'PostToolBatch';
|
|
1841
|
+
tool_calls: PostToolBatchToolCall[];
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
export declare type PostToolBatchHookSpecificOutput = {
|
|
1845
|
+
hookEventName: 'PostToolBatch';
|
|
1846
|
+
additionalContext?: string;
|
|
1847
|
+
};
|
|
1848
|
+
|
|
1849
|
+
export declare type PostToolBatchToolCall = {
|
|
1850
|
+
tool_name: string;
|
|
1851
|
+
tool_input: unknown;
|
|
1852
|
+
tool_use_id: string;
|
|
1853
|
+
tool_response?: unknown;
|
|
1854
|
+
};
|
|
1855
|
+
|
|
1778
1856
|
export declare type PostToolUseFailureHookInput = BaseHookInput & {
|
|
1779
1857
|
hook_event_name: 'PostToolUseFailure';
|
|
1780
1858
|
tool_name: string;
|
|
@@ -2385,6 +2463,13 @@ export declare type SDKControlGetContextUsageResponse = {
|
|
|
2385
2463
|
} | null;
|
|
2386
2464
|
};
|
|
2387
2465
|
|
|
2466
|
+
/**
|
|
2467
|
+
* 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.
|
|
2468
|
+
*/
|
|
2469
|
+
declare type SDKControlGetSessionCostRequest = {
|
|
2470
|
+
subtype: 'get_session_cost';
|
|
2471
|
+
};
|
|
2472
|
+
|
|
2388
2473
|
/**
|
|
2389
2474
|
* Returns the effective merged settings and the raw per-source settings.
|
|
2390
2475
|
*/
|
|
@@ -2402,6 +2487,10 @@ declare type SDKControlInitializeRequest = {
|
|
|
2402
2487
|
jsonSchema?: Record<string, unknown>;
|
|
2403
2488
|
systemPrompt?: string[];
|
|
2404
2489
|
appendSystemPrompt?: string;
|
|
2490
|
+
/**
|
|
2491
|
+
* Custom workflow body for the plan-mode system reminder. Replaces the default code-implementation phases; the CLI still wraps it with the read-only enforcement preamble and the ExitPlanMode protocol footer.
|
|
2492
|
+
*/
|
|
2493
|
+
planModeInstructions?: string;
|
|
2405
2494
|
|
|
2406
2495
|
/**
|
|
2407
2496
|
* When true, omit per-user dynamic sections (working directory, auto-memory path) from the cached system prompt and re-inject them as the first user message. Lets cross-user prompt caching hit on a static system prompt prefix. Tradeoff: the model sees this context slightly later in the prompt, so steering on the working directory and memory location is marginally less authoritative. Has no effect when a custom (non-preset) system prompt is in use.
|
|
@@ -2576,7 +2665,7 @@ export declare type SDKControlRequest = {
|
|
|
2576
2665
|
request: SDKControlRequestInner;
|
|
2577
2666
|
};
|
|
2578
2667
|
|
|
2579
|
-
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlReloadPluginsRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlChannelEnableRequest | SDKControlEndSessionRequest | SDKControlMcpAuthenticateRequest | SDKControlMcpClearAuthRequest | SDKControlMcpOAuthCallbackUrlRequest | SDKControlClaudeAuthenticateRequest | SDKControlClaudeOAuthCallbackRequest | SDKControlClaudeOAuthWaitForCompletionRequest | SDKControlRemoteControlRequest | SDKControlGenerateSessionTitleRequest | SDKControlSideQuestionRequest | SDKControlUltrareviewLaunchRequest | SDKControlMessageRatedRequest | SDKControlOAuthTokenRefreshRequest | SDKControlStopTaskRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest;
|
|
2668
|
+
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlReloadPluginsRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlChannelEnableRequest | SDKControlEndSessionRequest | SDKControlMcpAuthenticateRequest | SDKControlMcpClearAuthRequest | SDKControlMcpOAuthCallbackUrlRequest | SDKControlClaudeAuthenticateRequest | SDKControlClaudeOAuthCallbackRequest | SDKControlClaudeOAuthWaitForCompletionRequest | SDKControlRemoteControlRequest | SDKControlGenerateSessionTitleRequest | SDKControlSideQuestionRequest | SDKControlUltrareviewLaunchRequest | SDKControlMessageRatedRequest | SDKControlOAuthTokenRefreshRequest | SDKControlStopTaskRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest;
|
|
2580
2669
|
|
|
2581
2670
|
/**
|
|
2582
2671
|
* 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.
|
|
@@ -2617,6 +2706,14 @@ declare type SDKControlSeedReadStateRequest = {
|
|
|
2617
2706
|
mtime: number;
|
|
2618
2707
|
};
|
|
2619
2708
|
|
|
2709
|
+
/**
|
|
2710
|
+
* Sets the session accent color. Accepts an agent color name or "default" to reset.
|
|
2711
|
+
*/
|
|
2712
|
+
declare type SDKControlSetColorRequest = {
|
|
2713
|
+
subtype: 'set_color';
|
|
2714
|
+
color: string;
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2620
2717
|
/**
|
|
2621
2718
|
* Sets the maximum number of thinking tokens for extended thinking.
|
|
2622
2719
|
*/
|
|
@@ -2752,7 +2849,7 @@ declare type SDKKeepAliveMessage = {
|
|
|
2752
2849
|
};
|
|
2753
2850
|
|
|
2754
2851
|
/**
|
|
2755
|
-
* Output from a local slash command (e.g. /voice, /
|
|
2852
|
+
* Output from a local slash command (e.g. /voice, /usage). Displayed as assistant-style text in the transcript.
|
|
2756
2853
|
*/
|
|
2757
2854
|
export declare type SDKLocalCommandOutputMessage = {
|
|
2758
2855
|
type: 'system';
|
|
@@ -3111,6 +3208,13 @@ export declare type SDKSessionOptions = {
|
|
|
3111
3208
|
* - `'dontAsk'` - Don't prompt for permissions, deny if not pre-approved
|
|
3112
3209
|
*/
|
|
3113
3210
|
permissionMode?: PermissionMode;
|
|
3211
|
+
/**
|
|
3212
|
+
* Custom workflow instructions for plan mode. When `permissionMode` is
|
|
3213
|
+
* `'plan'`, this string replaces the default code-implementation workflow
|
|
3214
|
+
* body in the plan-mode system reminder. The CLI still wraps it with the
|
|
3215
|
+
* read-only enforcement preamble and the ExitPlanMode protocol footer.
|
|
3216
|
+
*/
|
|
3217
|
+
planModeInstructions?: string;
|
|
3114
3218
|
};
|
|
3115
3219
|
|
|
3116
3220
|
/**
|
|
@@ -3290,6 +3394,7 @@ export declare type SDKUserMessage = {
|
|
|
3290
3394
|
tool_use_result?: unknown;
|
|
3291
3395
|
priority?: 'now' | 'next' | 'later';
|
|
3292
3396
|
origin?: SDKMessageOrigin;
|
|
3397
|
+
|
|
3293
3398
|
/**
|
|
3294
3399
|
* When false, the message is appended to the transcript without triggering an assistant turn. It will be merged into the next user message that does query.
|
|
3295
3400
|
*/
|
|
@@ -3310,6 +3415,7 @@ export declare type SDKUserMessageReplay = {
|
|
|
3310
3415
|
tool_use_result?: unknown;
|
|
3311
3416
|
priority?: 'now' | 'next' | 'later';
|
|
3312
3417
|
origin?: SDKMessageOrigin;
|
|
3418
|
+
|
|
3313
3419
|
/**
|
|
3314
3420
|
* When false, the message is appended to the transcript without triggering an assistant turn. It will be merged into the next user message that does query.
|
|
3315
3421
|
*/
|
|
@@ -3444,6 +3550,22 @@ export declare type SessionStore = {
|
|
|
3444
3550
|
sessionId: string;
|
|
3445
3551
|
mtime: number;
|
|
3446
3552
|
}>>;
|
|
3553
|
+
/**
|
|
3554
|
+
* Return incrementally-maintained summaries for all sessions in one call.
|
|
3555
|
+
*
|
|
3556
|
+
* Stores should maintain these via {@link foldSessionSummary} inside
|
|
3557
|
+
* `append()`. When implemented, `listSessions({ sessionStore })` reads
|
|
3558
|
+
* all summary metadata in a single round-trip; when undefined, it falls
|
|
3559
|
+
* back to `listSessions()` + per-session `load()`.
|
|
3560
|
+
*
|
|
3561
|
+
* @remarks
|
|
3562
|
+
* Stores that maintain summaries inside `append()` MUST serialize sidecar
|
|
3563
|
+
* writes if `append()` calls can race for the same session — e.g., wrap the
|
|
3564
|
+
* read-fold-write in a transaction/CAS or hold a per-session lock.
|
|
3565
|
+
* `foldSessionSummary` is pure; concurrency control is the store's responsibility.
|
|
3566
|
+
* @alpha
|
|
3567
|
+
*/
|
|
3568
|
+
listSessionSummaries?(projectKey: string): Promise<SessionSummaryEntry[]>;
|
|
3447
3569
|
/**
|
|
3448
3570
|
* Delete a session. Optional — if undefined, deletion is a no-op
|
|
3449
3571
|
* (appropriate for WORM/append-only backends like S3).
|
|
@@ -3480,6 +3602,31 @@ export declare type SessionStoreEntry = {
|
|
|
3480
3602
|
[k: string]: unknown;
|
|
3481
3603
|
};
|
|
3482
3604
|
|
|
3605
|
+
/**
|
|
3606
|
+
* Incrementally-maintained session summary.
|
|
3607
|
+
*
|
|
3608
|
+
* Stores update this on {@link SessionStore.append} via
|
|
3609
|
+
* {@link foldSessionSummary} and return the full set from
|
|
3610
|
+
* {@link SessionStore.listSessionSummaries}. Adapters never re-read
|
|
3611
|
+
* previously appended entries.
|
|
3612
|
+
* @alpha
|
|
3613
|
+
*/
|
|
3614
|
+
export declare type SessionSummaryEntry = {
|
|
3615
|
+
sessionId: string;
|
|
3616
|
+
/**
|
|
3617
|
+
* Storage write time of the sidecar on the adapter. Must share a clock
|
|
3618
|
+
* source with the `mtime` returned by `listSessions()` for this session —
|
|
3619
|
+
* typically file mtime, S3 LastModified, Postgres `updated_at`, or whatever
|
|
3620
|
+
* native timestamp the adapter surfaces. Do not derive from entry ISO
|
|
3621
|
+
* timestamps — entry timestamps and storage write times can differ by
|
|
3622
|
+
* batching and network latency, and conflating them defeats the staleness
|
|
3623
|
+
* check.
|
|
3624
|
+
*/
|
|
3625
|
+
mtime: number;
|
|
3626
|
+
/** Opaque SDK-owned state. Stores MUST persist verbatim and MUST NOT interpret. */
|
|
3627
|
+
data: Record<string, unknown>;
|
|
3628
|
+
};
|
|
3629
|
+
|
|
3483
3630
|
/**
|
|
3484
3631
|
* AUTO-GENERATED - DO NOT EDIT
|
|
3485
3632
|
*
|
|
@@ -3536,6 +3683,10 @@ export declare interface Settings {
|
|
|
3536
3683
|
* Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost.
|
|
3537
3684
|
*/
|
|
3538
3685
|
skillListingBudgetFraction?: number;
|
|
3686
|
+
/**
|
|
3687
|
+
* When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect.
|
|
3688
|
+
*/
|
|
3689
|
+
wslInheritsWindowsSettings?: boolean;
|
|
3539
3690
|
/**
|
|
3540
3691
|
* Environment variables to set for Claude Code sessions
|
|
3541
3692
|
*/
|
|
@@ -3807,6 +3958,41 @@ export declare interface Settings {
|
|
|
3807
3958
|
* If true, hook runs once and is removed after execution
|
|
3808
3959
|
*/
|
|
3809
3960
|
once?: boolean;
|
|
3961
|
+
} | {
|
|
3962
|
+
/**
|
|
3963
|
+
* MCP tool hook type
|
|
3964
|
+
*/
|
|
3965
|
+
type: 'mcp_tool';
|
|
3966
|
+
/**
|
|
3967
|
+
* Name of an already-configured MCP server to invoke
|
|
3968
|
+
*/
|
|
3969
|
+
server: string;
|
|
3970
|
+
/**
|
|
3971
|
+
* Name of the tool on that server to call
|
|
3972
|
+
*/
|
|
3973
|
+
tool: string;
|
|
3974
|
+
/**
|
|
3975
|
+
* Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").
|
|
3976
|
+
*/
|
|
3977
|
+
input?: {
|
|
3978
|
+
[k: string]: unknown;
|
|
3979
|
+
};
|
|
3980
|
+
/**
|
|
3981
|
+
* Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.
|
|
3982
|
+
*/
|
|
3983
|
+
if?: string;
|
|
3984
|
+
/**
|
|
3985
|
+
* Timeout in seconds for this specific tool call
|
|
3986
|
+
*/
|
|
3987
|
+
timeout?: number;
|
|
3988
|
+
/**
|
|
3989
|
+
* Custom status message to display in spinner while hook runs
|
|
3990
|
+
*/
|
|
3991
|
+
statusMessage?: string;
|
|
3992
|
+
/**
|
|
3993
|
+
* If true, hook runs once and is removed after execution
|
|
3994
|
+
*/
|
|
3995
|
+
once?: boolean;
|
|
3810
3996
|
})[];
|
|
3811
3997
|
}[];
|
|
3812
3998
|
};
|
|
@@ -4003,20 +4189,6 @@ export declare interface Settings {
|
|
|
4003
4189
|
* Custom NPM registry URL (defaults to using system default, likely npmjs.org)
|
|
4004
4190
|
*/
|
|
4005
4191
|
registry?: string;
|
|
4006
|
-
} | {
|
|
4007
|
-
source: 'pip';
|
|
4008
|
-
/**
|
|
4009
|
-
* Python package name as it appears on PyPI
|
|
4010
|
-
*/
|
|
4011
|
-
package: string;
|
|
4012
|
-
/**
|
|
4013
|
-
* Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)
|
|
4014
|
-
*/
|
|
4015
|
-
version?: string;
|
|
4016
|
-
/**
|
|
4017
|
-
* Custom PyPI registry URL (defaults to using system default, likely pypi.org)
|
|
4018
|
-
*/
|
|
4019
|
-
registry?: string;
|
|
4020
4192
|
} | {
|
|
4021
4193
|
source: 'url';
|
|
4022
4194
|
/**
|
|
@@ -4205,20 +4377,6 @@ export declare interface Settings {
|
|
|
4205
4377
|
* Custom NPM registry URL (defaults to using system default, likely npmjs.org)
|
|
4206
4378
|
*/
|
|
4207
4379
|
registry?: string;
|
|
4208
|
-
} | {
|
|
4209
|
-
source: 'pip';
|
|
4210
|
-
/**
|
|
4211
|
-
* Python package name as it appears on PyPI
|
|
4212
|
-
*/
|
|
4213
|
-
package: string;
|
|
4214
|
-
/**
|
|
4215
|
-
* Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)
|
|
4216
|
-
*/
|
|
4217
|
-
version?: string;
|
|
4218
|
-
/**
|
|
4219
|
-
* Custom PyPI registry URL (defaults to using system default, likely pypi.org)
|
|
4220
|
-
*/
|
|
4221
|
-
registry?: string;
|
|
4222
4380
|
} | {
|
|
4223
4381
|
source: 'url';
|
|
4224
4382
|
/**
|
|
@@ -4397,20 +4555,6 @@ export declare interface Settings {
|
|
|
4397
4555
|
* Custom NPM registry URL (defaults to using system default, likely npmjs.org)
|
|
4398
4556
|
*/
|
|
4399
4557
|
registry?: string;
|
|
4400
|
-
} | {
|
|
4401
|
-
source: 'pip';
|
|
4402
|
-
/**
|
|
4403
|
-
* Python package name as it appears on PyPI
|
|
4404
|
-
*/
|
|
4405
|
-
package: string;
|
|
4406
|
-
/**
|
|
4407
|
-
* Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)
|
|
4408
|
-
*/
|
|
4409
|
-
version?: string;
|
|
4410
|
-
/**
|
|
4411
|
-
* Custom PyPI registry URL (defaults to using system default, likely pypi.org)
|
|
4412
|
-
*/
|
|
4413
|
-
registry?: string;
|
|
4414
4558
|
} | {
|
|
4415
4559
|
source: 'url';
|
|
4416
4560
|
/**
|
|
@@ -4952,7 +5096,7 @@ export declare type SyncHookJSONOutput = {
|
|
|
4952
5096
|
systemMessage?: string;
|
|
4953
5097
|
reason?: string;
|
|
4954
5098
|
|
|
4955
|
-
hookSpecificOutput?: PreToolUseHookSpecificOutput | UserPromptSubmitHookSpecificOutput | UserPromptExpansionHookSpecificOutput | SessionStartHookSpecificOutput | SetupHookSpecificOutput | SubagentStartHookSpecificOutput | PostToolUseHookSpecificOutput | PostToolUseFailureHookSpecificOutput | PermissionDeniedHookSpecificOutput | NotificationHookSpecificOutput | PermissionRequestHookSpecificOutput | ElicitationHookSpecificOutput | ElicitationResultHookSpecificOutput | CwdChangedHookSpecificOutput | FileChangedHookSpecificOutput | WorktreeCreateHookSpecificOutput;
|
|
5099
|
+
hookSpecificOutput?: PreToolUseHookSpecificOutput | UserPromptSubmitHookSpecificOutput | UserPromptExpansionHookSpecificOutput | SessionStartHookSpecificOutput | SetupHookSpecificOutput | SubagentStartHookSpecificOutput | PostToolUseHookSpecificOutput | PostToolUseFailureHookSpecificOutput | PostToolBatchHookSpecificOutput | PermissionDeniedHookSpecificOutput | NotificationHookSpecificOutput | PermissionRequestHookSpecificOutput | ElicitationHookSpecificOutput | ElicitationResultHookSpecificOutput | CwdChangedHookSpecificOutput | FileChangedHookSpecificOutput | WorktreeCreateHookSpecificOutput;
|
|
4956
5100
|
};
|
|
4957
5101
|
|
|
4958
5102
|
/**
|