@anthropic-ai/claude-agent-sdk 0.1.5 → 0.1.9
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 +2370 -2494
- package/package.json +1 -1
- package/sdk.mjs +8 -10
- package/sdkTypes.d.ts +3 -13
package/package.json
CHANGED
package/sdk.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
// (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms).
|
|
4
3
|
|
|
5
|
-
// Version: 0.1.
|
|
4
|
+
// Version: 0.1.9
|
|
6
5
|
|
|
7
6
|
// Want to see the unminified source? We're hiring!
|
|
8
7
|
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
|
9
|
-
|
|
10
8
|
var __create = Object.create;
|
|
11
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
12
10
|
var __defProp = Object.defineProperty;
|
|
@@ -6222,15 +6220,9 @@ import { createInterface } from "readline";
|
|
|
6222
6220
|
import * as fs from "fs";
|
|
6223
6221
|
import { stat as statPromise, open } from "fs/promises";
|
|
6224
6222
|
var NodeFsOperations = {
|
|
6225
|
-
accessSync(fsPath, mode) {
|
|
6226
|
-
fs.accessSync(fsPath, mode);
|
|
6227
|
-
},
|
|
6228
6223
|
cwd() {
|
|
6229
6224
|
return process.cwd();
|
|
6230
6225
|
},
|
|
6231
|
-
chmodSync(fsPath, mode) {
|
|
6232
|
-
fs.chmodSync(fsPath, mode);
|
|
6233
|
-
},
|
|
6234
6226
|
existsSync(fsPath) {
|
|
6235
6227
|
return fs.existsSync(fsPath);
|
|
6236
6228
|
},
|
|
@@ -6375,6 +6367,7 @@ class ProcessTransport {
|
|
|
6375
6367
|
stderr,
|
|
6376
6368
|
customSystemPrompt,
|
|
6377
6369
|
appendSystemPrompt,
|
|
6370
|
+
maxThinkingTokens,
|
|
6378
6371
|
maxTurns,
|
|
6379
6372
|
model,
|
|
6380
6373
|
fallbackModel,
|
|
@@ -6401,6 +6394,9 @@ class ProcessTransport {
|
|
|
6401
6394
|
args.push("--system-prompt", customSystemPrompt);
|
|
6402
6395
|
if (appendSystemPrompt)
|
|
6403
6396
|
args.push("--append-system-prompt", appendSystemPrompt);
|
|
6397
|
+
if (maxThinkingTokens !== undefined) {
|
|
6398
|
+
args.push("--max-thinking-tokens", maxThinkingTokens.toString());
|
|
6399
|
+
}
|
|
6404
6400
|
if (maxTurns)
|
|
6405
6401
|
args.push("--max-turns", maxTurns.toString());
|
|
6406
6402
|
if (model)
|
|
@@ -7167,6 +7163,7 @@ function createSharedQuery({
|
|
|
7167
7163
|
forkSession,
|
|
7168
7164
|
hooks,
|
|
7169
7165
|
includePartialMessages,
|
|
7166
|
+
maxThinkingTokens,
|
|
7170
7167
|
maxTurns,
|
|
7171
7168
|
mcpServers,
|
|
7172
7169
|
model,
|
|
@@ -7219,6 +7216,7 @@ function createSharedQuery({
|
|
|
7219
7216
|
stderr,
|
|
7220
7217
|
customSystemPrompt,
|
|
7221
7218
|
appendSystemPrompt,
|
|
7219
|
+
maxThinkingTokens,
|
|
7222
7220
|
maxTurns,
|
|
7223
7221
|
model,
|
|
7224
7222
|
fallbackModel,
|
|
@@ -14154,7 +14152,7 @@ function query({
|
|
|
14154
14152
|
const dirname = join(filename, "..");
|
|
14155
14153
|
pathToClaudeCodeExecutable = join(dirname, "cli.js");
|
|
14156
14154
|
}
|
|
14157
|
-
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.
|
|
14155
|
+
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.9";
|
|
14158
14156
|
return createSharedQuery({
|
|
14159
14157
|
prompt,
|
|
14160
14158
|
options: {
|
package/sdkTypes.d.ts
CHANGED
|
@@ -382,19 +382,9 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
382
382
|
mcpServerStatus(): Promise<McpServerStatus[]>;
|
|
383
383
|
}
|
|
384
384
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* - Yields a message at a time
|
|
389
|
-
* - Uses the tools and commands you give it
|
|
390
|
-
*
|
|
391
|
-
* Usage:
|
|
392
|
-
* ```ts
|
|
393
|
-
* const response = query({ prompt: "Help me write a function", options: {} })
|
|
394
|
-
* for await (const message of response) {
|
|
395
|
-
* console.log(message)
|
|
396
|
-
* }
|
|
397
|
-
* ```
|
|
385
|
+
* @deprecated The Claude Code SDK is now the Claude Agent SDK!
|
|
386
|
+
* Please install and use @anthropic-ai/claude-agent-sdk instead.
|
|
387
|
+
* See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.
|
|
398
388
|
*/
|
|
399
389
|
export declare function query({ prompt, options, }: {
|
|
400
390
|
prompt: string | AsyncIterable<SDKUserMessage>;
|