@anthropic-ai/claude-code 1.0.26 → 1.0.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-code",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "bin": {
package/sdk.d.ts CHANGED
@@ -45,6 +45,7 @@ export type Options = {
45
45
  continue?: boolean
46
46
  resume?: string
47
47
  model?: string
48
+ fallbackModel?: string
48
49
  }
49
50
 
50
51
  export type PermissionMode =
package/sdk.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms).
2
2
 
3
- // Version: 1.0.26
3
+ // Version: 1.0.28
4
4
 
5
5
  // src/entrypoints/sdk.ts
6
6
  import { spawn } from "child_process";
@@ -28,10 +28,13 @@ async function* query({
28
28
  permissionPromptToolName,
29
29
  continue: continueConversation,
30
30
  resume,
31
- model
31
+ model,
32
+ fallbackModel
32
33
  } = {}
33
34
  }) {
34
- process.env.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
35
+ if (!process.env.CLAUDE_CODE_ENTRYPOINT) {
36
+ process.env.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
37
+ }
35
38
  const args = ["--output-format", "stream-json", "--verbose"];
36
39
  if (customSystemPrompt)
37
40
  args.push("--system-prompt", customSystemPrompt);
@@ -59,6 +62,12 @@ async function* query({
59
62
  if (permissionMode !== "default") {
60
63
  args.push("--permission-mode", permissionMode);
61
64
  }
65
+ if (fallbackModel) {
66
+ if (model && fallbackModel === model) {
67
+ throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");
68
+ }
69
+ args.push("--fallback-model", fallbackModel);
70
+ }
62
71
  if (!prompt.trim()) {
63
72
  throw new RangeError("Prompt is required");
64
73
  }
Binary file