@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/cli.js +629 -615
- package/package.json +1 -1
- package/sdk.d.ts +1 -0
- package/sdk.mjs +12 -3
- package/vendor/claude-code.vsix +0 -0
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
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.
|
|
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
|
|
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
|
}
|
package/vendor/claude-code.vsix
CHANGED
|
Binary file
|