@anthropic-ai/claude-code 2.0.5 → 2.0.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.
Files changed (4) hide show
  1. package/cli.js +2370 -2494
  2. package/package.json +1 -1
  3. package/sdk.d.ts +3 -13
  4. package/sdk.mjs +8 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-code",
3
- "version": "2.0.5",
3
+ "version": "2.0.9",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "bin": {
package/sdk.d.ts CHANGED
@@ -382,19 +382,9 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
382
382
  mcpServerStatus(): Promise<McpServerStatus[]>;
383
383
  }
384
384
  /**
385
- * Query Claude Code
386
- *
387
- * Behavior:
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>;
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: 2.0.5
4
+ // Version: 2.0.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,
@@ -14139,6 +14137,7 @@ function query({
14139
14137
  prompt,
14140
14138
  options
14141
14139
  }) {
14140
+ console.warn("The Claude Code SDK is now the Claude Agent SDK! " + "Please install and use @anthropic-ai/claude-agent-sdk instead. " + "See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.");
14142
14141
  let pathToClaudeCodeExecutable = options?.pathToClaudeCodeExecutable;
14143
14142
  if (!pathToClaudeCodeExecutable) {
14144
14143
  const filename = fileURLToPath(import.meta.url);