@anthropic-ai/claude-code 2.0.10 → 2.0.12
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/LICENSE.md +1 -1
- package/cli.js +1478 -1465
- package/package.json +1 -1
- package/sdk.d.ts +10 -0
- package/sdk.mjs +7 -4
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -268,6 +268,14 @@ export type ModelInfo = {
|
|
|
268
268
|
displayName: string;
|
|
269
269
|
description: string;
|
|
270
270
|
};
|
|
271
|
+
/** Information about the logged in user's account. */
|
|
272
|
+
export type AccountInfo = {
|
|
273
|
+
email?: string;
|
|
274
|
+
organization?: string;
|
|
275
|
+
subscriptionType?: string;
|
|
276
|
+
tokenSource?: string;
|
|
277
|
+
apiKeySource?: string;
|
|
278
|
+
};
|
|
271
279
|
export type McpServerStatus = {
|
|
272
280
|
name: string;
|
|
273
281
|
status: 'connected' | 'failed' | 'needs-auth' | 'pending';
|
|
@@ -381,10 +389,12 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
381
389
|
supportedCommands(): Promise<SlashCommand[]>;
|
|
382
390
|
supportedModels(): Promise<ModelInfo[]>;
|
|
383
391
|
mcpServerStatus(): Promise<McpServerStatus[]>;
|
|
392
|
+
accountInfo(): Promise<AccountInfo>;
|
|
384
393
|
}
|
|
385
394
|
/**
|
|
386
395
|
* @deprecated The Claude Code SDK is now the Claude Agent SDK!
|
|
387
396
|
* Please install and use @anthropic-ai/claude-agent-sdk instead.
|
|
397
|
+
* This SDK entrypoint will be going away on October 21.
|
|
388
398
|
* See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.
|
|
389
399
|
*/
|
|
390
400
|
export declare function query({ prompt, options, }: {
|
package/sdk.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// (c) Anthropic PBC. All rights reserved. Use is subject to
|
|
2
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://docs.claude.com/en/docs/claude-code/legal-and-compliance.
|
|
3
3
|
|
|
4
|
-
// Version: 2.0.
|
|
4
|
+
// Version: 2.0.12
|
|
5
5
|
|
|
6
6
|
// Want to see the unminified source? We're hiring!
|
|
7
7
|
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
|
@@ -7046,6 +7046,9 @@ class Query {
|
|
|
7046
7046
|
const mcpStatusResponse = response.response;
|
|
7047
7047
|
return mcpStatusResponse.mcpServers;
|
|
7048
7048
|
}
|
|
7049
|
+
async accountInfo() {
|
|
7050
|
+
return (await this.initialization).account;
|
|
7051
|
+
}
|
|
7049
7052
|
async streamInput(stream) {
|
|
7050
7053
|
try {
|
|
7051
7054
|
for await (const message of stream) {
|
|
@@ -7055,7 +7058,7 @@ class Query {
|
|
|
7055
7058
|
`));
|
|
7056
7059
|
}
|
|
7057
7060
|
if (this.sdkMcpTransports.size > 0 && this.firstResultReceivedPromise) {
|
|
7058
|
-
const STREAM_CLOSE_TIMEOUT =
|
|
7061
|
+
const STREAM_CLOSE_TIMEOUT = 60000;
|
|
7059
7062
|
let timeoutId;
|
|
7060
7063
|
await Promise.race([
|
|
7061
7064
|
this.firstResultReceivedPromise.then(() => {
|
|
@@ -14137,7 +14140,7 @@ function query({
|
|
|
14137
14140
|
prompt,
|
|
14138
14141
|
options
|
|
14139
14142
|
}) {
|
|
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.");
|
|
14143
|
+
console.warn("The Claude Code SDK is now the Claude Agent SDK! " + "Please install and use @anthropic-ai/claude-agent-sdk instead. " + "This SDK entrypoint will be going away on October 21. " + "See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.");
|
|
14141
14144
|
let pathToClaudeCodeExecutable = options?.pathToClaudeCodeExecutable;
|
|
14142
14145
|
if (!pathToClaudeCodeExecutable) {
|
|
14143
14146
|
const filename = fileURLToPath(import.meta.url);
|