@anthropic-ai/claude-agent-sdk 0.2.58 → 0.2.59
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/cli.js +1764 -1746
- package/manifest.json +18 -18
- package/manifest.zst.json +18 -18
- package/package.json +2 -2
- package/sdk.d.ts +36 -0
- package/sdk.mjs +21 -20
package/manifest.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"buildDate": "2026-02-
|
|
2
|
+
"version": "2.1.59",
|
|
3
|
+
"buildDate": "2026-02-25T23:40:08Z",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"binary": "claude",
|
|
7
|
-
"checksum": "
|
|
8
|
-
"size":
|
|
7
|
+
"checksum": "ef70dae6ed08b5538f6d157a8c8591f72c262fb8e570c94711bad3ae4ee44afa",
|
|
8
|
+
"size": 187104656
|
|
9
9
|
},
|
|
10
10
|
"darwin-x64": {
|
|
11
11
|
"binary": "claude",
|
|
12
|
-
"checksum": "
|
|
13
|
-
"size":
|
|
12
|
+
"checksum": "b3b69beae466ac1b7659bf5710ec1d5e7b20c848418cc701019462e0923ff0e0",
|
|
13
|
+
"size": 192258768
|
|
14
14
|
},
|
|
15
15
|
"linux-arm64": {
|
|
16
16
|
"binary": "claude",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "78b0ea5a64793149f550ad3ddcfcbc7147128a600243839f703fb5b6a2194859",
|
|
18
|
+
"size": 224884646
|
|
19
19
|
},
|
|
20
20
|
"linux-x64": {
|
|
21
21
|
"binary": "claude",
|
|
22
|
-
"checksum": "
|
|
23
|
-
"size":
|
|
22
|
+
"checksum": "7a4a653982b07e0a8157f8d3b2c2f8e442520ab07b2fa2e692ba054dbba210c9",
|
|
23
|
+
"size": 227880817
|
|
24
24
|
},
|
|
25
25
|
"linux-arm64-musl": {
|
|
26
26
|
"binary": "claude",
|
|
27
|
-
"checksum": "
|
|
28
|
-
"size":
|
|
27
|
+
"checksum": "4f16635c098b8302d5eaf83fe726c3582e00d91cf56a37d18d0c91efbcac6cd9",
|
|
28
|
+
"size": 217281606
|
|
29
29
|
},
|
|
30
30
|
"linux-x64-musl": {
|
|
31
31
|
"binary": "claude",
|
|
32
|
-
"checksum": "
|
|
33
|
-
"size":
|
|
32
|
+
"checksum": "3adaebe59f10524bd9d19ebb3d090c3207b67143c0f40ec1cfc544409f8ded60",
|
|
33
|
+
"size": 219578057
|
|
34
34
|
},
|
|
35
35
|
"win32-x64": {
|
|
36
36
|
"binary": "claude.exe",
|
|
37
|
-
"checksum": "
|
|
38
|
-
"size":
|
|
37
|
+
"checksum": "6dfdfa45ce01928317abb6c3774e0c533952c471002e468dd254022acd39e268",
|
|
38
|
+
"size": 236043424
|
|
39
39
|
},
|
|
40
40
|
"win32-arm64": {
|
|
41
41
|
"binary": "claude.exe",
|
|
42
|
-
"checksum": "
|
|
43
|
-
"size":
|
|
42
|
+
"checksum": "aadd9629f391a76e23bab6d06f8a6fe38f01137831012c96356cac178820e960",
|
|
43
|
+
"size": 228253856
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
package/manifest.zst.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"buildDate": "2026-02-
|
|
2
|
+
"version": "2.1.59",
|
|
3
|
+
"buildDate": "2026-02-25T23:40:09Z",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"binary": "claude.zst",
|
|
7
|
-
"checksum": "
|
|
8
|
-
"size":
|
|
7
|
+
"checksum": "2c7b6b64ff84b32137f4ec9192ad123e1a4307ff8c87a39bcee976f972edadc8",
|
|
8
|
+
"size": 39568329
|
|
9
9
|
},
|
|
10
10
|
"darwin-x64": {
|
|
11
11
|
"binary": "claude.zst",
|
|
12
|
-
"checksum": "
|
|
13
|
-
"size":
|
|
12
|
+
"checksum": "a3fddc9042a929ffec3c85afb44c5e6c463e0e09ee3b52744bd48b550e34fe5d",
|
|
13
|
+
"size": 41753192
|
|
14
14
|
},
|
|
15
15
|
"linux-arm64": {
|
|
16
16
|
"binary": "claude.zst",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "d88c9ccdedcaa028f9d777f5f5dfced4bc8b8f1f16fe6ccf984d4cda67d18fc4",
|
|
18
|
+
"size": 50268125
|
|
19
19
|
},
|
|
20
20
|
"linux-x64": {
|
|
21
21
|
"binary": "claude.zst",
|
|
22
|
-
"checksum": "
|
|
23
|
-
"size":
|
|
22
|
+
"checksum": "f736b36fcd7cd43aa4f9d49b90ade42772d93d6b0d79392febd2b403e993b0bb",
|
|
23
|
+
"size": 50988214
|
|
24
24
|
},
|
|
25
25
|
"linux-arm64-musl": {
|
|
26
26
|
"binary": "claude.zst",
|
|
27
|
-
"checksum": "
|
|
28
|
-
"size":
|
|
27
|
+
"checksum": "e365ca494621cc22ab1f0a6529313c60fd61545864bb5125b345422a8914d385",
|
|
28
|
+
"size": 48590016
|
|
29
29
|
},
|
|
30
30
|
"linux-x64-musl": {
|
|
31
31
|
"binary": "claude.zst",
|
|
32
|
-
"checksum": "
|
|
33
|
-
"size":
|
|
32
|
+
"checksum": "8c542251bb243ffdf49edd102268a669759a064a232e44c321f5492e5e2328dd",
|
|
33
|
+
"size": 49199121
|
|
34
34
|
},
|
|
35
35
|
"win32-x64": {
|
|
36
36
|
"binary": "claude.exe.zst",
|
|
37
|
-
"checksum": "
|
|
38
|
-
"size":
|
|
37
|
+
"checksum": "6d67ce0325ddc4540a454974fab51d265cdefeaa221deb5e9d2797eb7937e8bc",
|
|
38
|
+
"size": 52890200
|
|
39
39
|
},
|
|
40
40
|
"win32-arm64": {
|
|
41
41
|
"binary": "claude.exe.zst",
|
|
42
|
-
"checksum": "
|
|
43
|
-
"size":
|
|
42
|
+
"checksum": "a4fcfd2c60fed9b75d2c5d26f49c749a46477759533e558d7f2c616d5491746b",
|
|
43
|
+
"size": 50267589
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
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.59",
|
|
4
4
|
"main": "sdk.mjs",
|
|
5
5
|
"types": "sdk.d.ts",
|
|
6
6
|
"engines": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@img/sharp-win32-arm64": "^0.34.2",
|
|
39
39
|
"@img/sharp-win32-x64": "^0.34.2"
|
|
40
40
|
},
|
|
41
|
-
"claudeCodeVersion": "2.1.
|
|
41
|
+
"claudeCodeVersion": "2.1.59"
|
|
42
42
|
}
|
package/sdk.d.ts
CHANGED
|
@@ -268,6 +268,30 @@ export declare const EXIT_REASONS: readonly ["clear", "logout", "prompt_input_ex
|
|
|
268
268
|
|
|
269
269
|
export declare type ExitReason = 'clear' | 'logout' | 'prompt_input_exit' | 'other' | 'bypass_permissions_disabled';
|
|
270
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Reads a session's conversation messages from its JSONL transcript file.
|
|
273
|
+
*
|
|
274
|
+
* Parses the transcript, builds the conversation chain via parentUuid links,
|
|
275
|
+
* and returns user/assistant messages in chronological order.
|
|
276
|
+
*
|
|
277
|
+
* @param sessionId - UUID of the session to read
|
|
278
|
+
* @param options - Optional dir, limit, and offset
|
|
279
|
+
* @returns Array of user/assistant messages, or empty array if session not found
|
|
280
|
+
*/
|
|
281
|
+
export declare function getSessionMessages(_sessionId: string, _options?: GetSessionMessagesOptions): Promise<SessionMessage[]>;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Options for retrieving session messages.
|
|
285
|
+
*/
|
|
286
|
+
export declare type GetSessionMessagesOptions = {
|
|
287
|
+
/** Project directory to find the session in. If omitted, searches all projects. */
|
|
288
|
+
dir?: string;
|
|
289
|
+
/** Maximum number of messages to return. */
|
|
290
|
+
limit?: number;
|
|
291
|
+
/** Number of messages to skip from the start. */
|
|
292
|
+
offset?: number;
|
|
293
|
+
};
|
|
294
|
+
|
|
271
295
|
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "Notification", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PermissionRequest", "Setup", "TeammateIdle", "TaskCompleted", "ConfigChange", "WorktreeCreate", "WorktreeRemove"];
|
|
272
296
|
|
|
273
297
|
/**
|
|
@@ -1876,6 +1900,18 @@ export declare type SessionEndHookInput = BaseHookInput & {
|
|
|
1876
1900
|
reason: ExitReason;
|
|
1877
1901
|
};
|
|
1878
1902
|
|
|
1903
|
+
/**
|
|
1904
|
+
* A user or assistant message from a session transcript.
|
|
1905
|
+
* Returned by `getSessionMessages` for reading historical session data.
|
|
1906
|
+
*/
|
|
1907
|
+
export declare type SessionMessage = {
|
|
1908
|
+
type: 'user' | 'assistant';
|
|
1909
|
+
uuid: string;
|
|
1910
|
+
session_id: string;
|
|
1911
|
+
message: unknown;
|
|
1912
|
+
parent_tool_use_id: null;
|
|
1913
|
+
};
|
|
1914
|
+
|
|
1879
1915
|
export declare type SessionStartHookInput = BaseHookInput & {
|
|
1880
1916
|
hook_event_name: 'SessionStart';
|
|
1881
1917
|
source: 'startup' | 'resume' | 'clear' | 'compact';
|