@anthropic-ai/claude-agent-sdk 0.1.57 → 0.1.58
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/LICENSE.md +1 -1
- package/README.md +2 -2
- package/cli.js +1171 -1166
- package/package.json +1 -1
- package/sdk.d.ts +7 -0
- package/sdk.mjs +9 -3
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ export type JsonSchemaOutputFormat = BaseOutputFormat & {
|
|
|
29
29
|
export type OutputFormat = JsonSchemaOutputFormat;
|
|
30
30
|
export type ApiKeySource = 'user' | 'project' | 'org' | 'temporary';
|
|
31
31
|
export type ConfigScope = 'local' | 'user' | 'project';
|
|
32
|
+
/**
|
|
33
|
+
* Allowed beta headers that can be passed via SDK options.
|
|
34
|
+
*/
|
|
35
|
+
export type SdkBeta = 'context-1m-2025-08-07';
|
|
32
36
|
export type McpStdioServerConfig = {
|
|
33
37
|
type?: 'stdio';
|
|
34
38
|
command: string;
|
|
@@ -405,6 +409,7 @@ export type SDKSystemMessage = {
|
|
|
405
409
|
subtype: 'init';
|
|
406
410
|
agents?: string[];
|
|
407
411
|
apiKeySource: ApiKeySource;
|
|
412
|
+
betas?: string[];
|
|
408
413
|
claude_code_version: string;
|
|
409
414
|
cwd: string;
|
|
410
415
|
tools: string[];
|
|
@@ -562,6 +567,7 @@ export type AgentDefinition = {
|
|
|
562
567
|
disallowedTools?: string[];
|
|
563
568
|
prompt: string;
|
|
564
569
|
model?: 'sonnet' | 'opus' | 'haiku' | 'inherit';
|
|
570
|
+
criticalSystemReminder_EXPERIMENTAL?: string;
|
|
565
571
|
};
|
|
566
572
|
export type SettingSource = 'user' | 'project' | 'local';
|
|
567
573
|
export type SdkPluginConfig = {
|
|
@@ -599,6 +605,7 @@ export type Options = {
|
|
|
599
605
|
* continuing the previous session. Use with --resume.
|
|
600
606
|
*/
|
|
601
607
|
forkSession?: boolean;
|
|
608
|
+
betas?: SdkBeta[];
|
|
602
609
|
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
603
610
|
includePartialMessages?: boolean;
|
|
604
611
|
maxThinkingTokens?: number;
|
package/sdk.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://
|
|
2
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
3
3
|
|
|
4
|
-
// Version: 0.1.
|
|
4
|
+
// Version: 0.1.58
|
|
5
5
|
|
|
6
6
|
// Want to see the unminified source? We're hiring!
|
|
7
7
|
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
|
@@ -6495,6 +6495,7 @@ class ProcessTransport {
|
|
|
6495
6495
|
try {
|
|
6496
6496
|
const {
|
|
6497
6497
|
additionalDirectories = [],
|
|
6498
|
+
betas,
|
|
6498
6499
|
cwd,
|
|
6499
6500
|
executable = isRunningWithBun() ? "bun" : "node",
|
|
6500
6501
|
executableArgs = [],
|
|
@@ -6540,6 +6541,9 @@ class ProcessTransport {
|
|
|
6540
6541
|
}
|
|
6541
6542
|
if (model)
|
|
6542
6543
|
args.push("--model", model);
|
|
6544
|
+
if (betas && betas.length > 0) {
|
|
6545
|
+
args.push("--betas", betas.join(","));
|
|
6546
|
+
}
|
|
6543
6547
|
if (jsonSchema) {
|
|
6544
6548
|
args.push("--json-schema", JSON.stringify(jsonSchema));
|
|
6545
6549
|
}
|
|
@@ -15100,12 +15104,13 @@ function query({
|
|
|
15100
15104
|
const dirname2 = join5(filename, "..");
|
|
15101
15105
|
pathToClaudeCodeExecutable = join5(dirname2, "cli.js");
|
|
15102
15106
|
}
|
|
15103
|
-
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.
|
|
15107
|
+
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.58";
|
|
15104
15108
|
const {
|
|
15105
15109
|
abortController = createAbortController(),
|
|
15106
15110
|
additionalDirectories = [],
|
|
15107
15111
|
agents,
|
|
15108
15112
|
allowedTools = [],
|
|
15113
|
+
betas,
|
|
15109
15114
|
canUseTool,
|
|
15110
15115
|
continue: continueConversation,
|
|
15111
15116
|
cwd: cwd2,
|
|
@@ -15164,6 +15169,7 @@ function query({
|
|
|
15164
15169
|
const transport = new ProcessTransport({
|
|
15165
15170
|
abortController,
|
|
15166
15171
|
additionalDirectories,
|
|
15172
|
+
betas,
|
|
15167
15173
|
cwd: cwd2,
|
|
15168
15174
|
executable,
|
|
15169
15175
|
executableArgs,
|