@anthropic-ai/claude-agent-sdk 0.1.21 → 0.1.22
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 +982 -983
- package/package.json +1 -1
- package/sdk.mjs +12 -3
- package/sdkTypes.d.ts +10 -2
package/package.json
CHANGED
package/sdk.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://docs.claude.com/en/docs/claude-code/legal-and-compliance.
|
|
3
3
|
|
|
4
|
-
// Version: 0.1.
|
|
4
|
+
// Version: 0.1.22
|
|
5
5
|
|
|
6
6
|
// Want to see the unminified source? We're hiring!
|
|
7
7
|
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
|
@@ -7403,6 +7403,10 @@ var isDebugToStdErr = memoize_default(() => {
|
|
|
7403
7403
|
return process.argv.includes("--debug-to-stderr") || process.argv.includes("-d2e");
|
|
7404
7404
|
});
|
|
7405
7405
|
function shouldLogDebugMessage(message) {
|
|
7406
|
+
if (false) {}
|
|
7407
|
+
if (typeof process === "undefined" || typeof process.versions === "undefined" || typeof process.versions.node === "undefined") {
|
|
7408
|
+
return false;
|
|
7409
|
+
}
|
|
7406
7410
|
const filter = getDebugFilter();
|
|
7407
7411
|
return shouldShowDebugMessage(message, filter);
|
|
7408
7412
|
}
|
|
@@ -7423,7 +7427,6 @@ function logForDebugging(message, { level } = {
|
|
|
7423
7427
|
writeToStderr(output);
|
|
7424
7428
|
return;
|
|
7425
7429
|
}
|
|
7426
|
-
if (false) {}
|
|
7427
7430
|
if (!getFsImplementation().existsSync(dirname(getDebugLogPath()))) {
|
|
7428
7431
|
getFsImplementation().mkdirSync(dirname(getDebugLogPath()));
|
|
7429
7432
|
}
|
|
@@ -7675,6 +7678,12 @@ class Query {
|
|
|
7675
7678
|
model
|
|
7676
7679
|
});
|
|
7677
7680
|
}
|
|
7681
|
+
async setMaxThinkingTokens(maxThinkingTokens) {
|
|
7682
|
+
await this.request({
|
|
7683
|
+
subtype: "set_max_thinking_tokens",
|
|
7684
|
+
max_thinking_tokens: maxThinkingTokens
|
|
7685
|
+
});
|
|
7686
|
+
}
|
|
7678
7687
|
request(request) {
|
|
7679
7688
|
const requestId = Math.random().toString(36).substring(2, 15);
|
|
7680
7689
|
const sdkRequest = {
|
|
@@ -14827,7 +14836,7 @@ function query({
|
|
|
14827
14836
|
const dirname2 = join3(filename, "..");
|
|
14828
14837
|
pathToClaudeCodeExecutable = join3(dirname2, "cli.js");
|
|
14829
14838
|
}
|
|
14830
|
-
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.
|
|
14839
|
+
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.22";
|
|
14831
14840
|
return createSharedQuery({
|
|
14832
14841
|
prompt,
|
|
14833
14842
|
options: {
|
package/sdkTypes.d.ts
CHANGED
|
@@ -384,8 +384,6 @@ export type SDKHookResponseMessage = SDKMessageBase & {
|
|
|
384
384
|
subtype: 'hook_response';
|
|
385
385
|
hook_name: string;
|
|
386
386
|
hook_event: string;
|
|
387
|
-
tool_name?: string;
|
|
388
|
-
response: SyncHookJSONOutput;
|
|
389
387
|
stdout: string;
|
|
390
388
|
stderr: string;
|
|
391
389
|
exit_code?: number;
|
|
@@ -400,6 +398,16 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
400
398
|
interrupt(): Promise<void>;
|
|
401
399
|
setPermissionMode(mode: PermissionMode): Promise<void>;
|
|
402
400
|
setModel(model?: string): Promise<void>;
|
|
401
|
+
/**
|
|
402
|
+
* Set the maximum number of thinking tokens the model is allowed to use
|
|
403
|
+
* when generating its response. This can be used to limit the amount of
|
|
404
|
+
* tokens the model uses for its response, which can help control cost and
|
|
405
|
+
* latency.
|
|
406
|
+
*
|
|
407
|
+
* Use `null` to clear any previously set limit and allow the model to
|
|
408
|
+
* use the default maximum thinking tokens.
|
|
409
|
+
*/
|
|
410
|
+
setMaxThinkingTokens(maxThinkingTokens: number | null): Promise<void>;
|
|
403
411
|
supportedCommands(): Promise<SlashCommand[]>;
|
|
404
412
|
supportedModels(): Promise<ModelInfo[]>;
|
|
405
413
|
mcpServerStatus(): Promise<McpServerStatus[]>;
|