@anthropic-ai/claude-code 1.0.21 → 1.0.23
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 +663 -625
- package/package.json +2 -1
- package/sdk.d.ts +3 -5
- package/sdk.mjs +8 -5
- package/vendor/claude-code.vsix +0 -0
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type Options = {
|
|
|
44
44
|
permissionPromptToolName?: string
|
|
45
45
|
continue?: boolean
|
|
46
46
|
resume?: string
|
|
47
|
-
|
|
47
|
+
model?: string
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export type PermissionMode =
|
|
@@ -71,26 +71,24 @@ export type SDKResultMessage =
|
|
|
71
71
|
| {
|
|
72
72
|
type: 'result'
|
|
73
73
|
subtype: 'success'
|
|
74
|
-
cost_usd: number
|
|
75
74
|
duration_ms: number
|
|
76
75
|
duration_api_ms: number
|
|
77
76
|
is_error: boolean
|
|
78
77
|
num_turns: number
|
|
79
78
|
result: string
|
|
80
79
|
session_id: string
|
|
81
|
-
|
|
80
|
+
total_cost_usd: number
|
|
82
81
|
usage: NonNullableUsage
|
|
83
82
|
}
|
|
84
83
|
| {
|
|
85
84
|
type: 'result'
|
|
86
85
|
subtype: 'error_max_turns' | 'error_during_execution'
|
|
87
|
-
cost_usd: number
|
|
88
86
|
duration_ms: number
|
|
89
87
|
duration_api_ms: number
|
|
90
88
|
is_error: boolean
|
|
91
89
|
num_turns: number
|
|
92
90
|
session_id: string
|
|
93
|
-
|
|
91
|
+
total_cost_usd: number
|
|
94
92
|
usage: NonNullableUsage
|
|
95
93
|
}
|
|
96
94
|
|
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.23
|
|
4
4
|
|
|
5
5
|
// src/entrypoints/sdk.ts
|
|
6
6
|
import { spawn } from "child_process";
|
|
@@ -19,7 +19,7 @@ async function* query({
|
|
|
19
19
|
customSystemPrompt,
|
|
20
20
|
cwd,
|
|
21
21
|
disallowedTools = [],
|
|
22
|
-
executable = "node",
|
|
22
|
+
executable = isRunningWithBun() ? "bun" : "node",
|
|
23
23
|
executableArgs = [],
|
|
24
24
|
maxTurns,
|
|
25
25
|
mcpServers,
|
|
@@ -28,7 +28,7 @@ async function* query({
|
|
|
28
28
|
permissionPromptToolName,
|
|
29
29
|
continue: continueConversation,
|
|
30
30
|
resume,
|
|
31
|
-
|
|
31
|
+
model
|
|
32
32
|
} = {}
|
|
33
33
|
}) {
|
|
34
34
|
process.env.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
|
|
@@ -39,8 +39,8 @@ async function* query({
|
|
|
39
39
|
args.push("--append-system-prompt", appendSystemPrompt);
|
|
40
40
|
if (maxTurns)
|
|
41
41
|
args.push("--max-turns", maxTurns.toString());
|
|
42
|
-
if (
|
|
43
|
-
args.push("--model",
|
|
42
|
+
if (model)
|
|
43
|
+
args.push("--model", model);
|
|
44
44
|
if (permissionPromptToolName)
|
|
45
45
|
args.push("--permission-prompt-tool", permissionPromptToolName);
|
|
46
46
|
if (continueConversation)
|
|
@@ -132,6 +132,9 @@ function logDebug(message) {
|
|
|
132
132
|
console.debug(message);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
function isRunningWithBun() {
|
|
136
|
+
return process.versions.bun !== undefined || process.env.BUN_INSTALL !== undefined;
|
|
137
|
+
}
|
|
135
138
|
|
|
136
139
|
class AbortError extends Error {
|
|
137
140
|
}
|
package/vendor/claude-code.vsix
CHANGED
|
Binary file
|