@anthropic-ai/claude-agent-sdk 0.1.31 → 0.1.34

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 +2663 -2461
  2. package/package.json +1 -1
  3. package/sdk.d.ts +1 -0
  4. package/sdk.mjs +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.1.31",
3
+ "version": "0.1.34",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "engines": {
package/sdk.d.ts CHANGED
@@ -219,6 +219,7 @@ export type SyncHookJSONOutput = {
219
219
  } | {
220
220
  hookEventName: 'PostToolUse';
221
221
  additionalContext?: string;
222
+ updatedMCPToolOutput?: unknown;
222
223
  };
223
224
  };
224
225
  export type HookJSONOutput = AsyncHookJSONOutput | SyncHookJSONOutput;
package/sdk.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
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: 0.1.31
4
+ // Version: 0.1.34
5
5
 
6
6
  // Want to see the unminified source? We're hiring!
7
7
  // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
@@ -7369,7 +7369,10 @@ var maxOutputTokensValidator = {
7369
7369
 
7370
7370
  // ../src/bootstrap/state.ts
7371
7371
  function getInitialState() {
7372
- const resolvedCwd = realpathSync2(cwd());
7372
+ let resolvedCwd = "";
7373
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
7374
+ resolvedCwd = realpathSync2(cwd());
7375
+ }
7373
7376
  return {
7374
7377
  originalCwd: resolvedCwd,
7375
7378
  totalCostUSD: 0,
@@ -7520,7 +7523,10 @@ class Query {
7520
7523
  this.canUseTool = canUseTool;
7521
7524
  this.hooks = hooks;
7522
7525
  this.abortController = abortController;
7523
- this.streamCloseTimeout = parseInt(process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT || "") || 60000;
7526
+ this.streamCloseTimeout = 60000;
7527
+ if (typeof process !== "undefined" && process.env?.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT) {
7528
+ this.streamCloseTimeout = parseInt(process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT);
7529
+ }
7524
7530
  for (const [name, server] of sdkMcpServers) {
7525
7531
  const sdkTransport = new SdkControlServerTransport((message) => this.sendMcpServerMessageToCli(name, message));
7526
7532
  this.sdkMcpTransports.set(name, sdkTransport);
@@ -14770,7 +14776,7 @@ function query({
14770
14776
  const dirname2 = join3(filename, "..");
14771
14777
  pathToClaudeCodeExecutable = join3(dirname2, "cli.js");
14772
14778
  }
14773
- process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.31";
14779
+ process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.34";
14774
14780
  const {
14775
14781
  abortController = createAbortController(),
14776
14782
  additionalDirectories = [],