@anthropic-ai/claude-code 1.0.98 → 1.0.102

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.98",
3
+ "version": "1.0.102",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "bin": {
package/sdk-tools.d.ts CHANGED
@@ -52,18 +52,18 @@ export interface BashInput {
52
52
  */
53
53
  timeout?: number;
54
54
  /**
55
- * Clear, concise description of what this command does in 5-10 words. Examples:
55
+ * Clear, concise description of what this command does in 5-10 words, in active voice. Examples:
56
56
  * Input: ls
57
- * Output: Lists files in current directory
57
+ * Output: List files in current directory
58
58
  *
59
59
  * Input: git status
60
- * Output: Shows working tree status
60
+ * Output: Show working tree status
61
61
  *
62
62
  * Input: npm install
63
- * Output: Installs package dependencies
63
+ * Output: Install package dependencies
64
64
  *
65
65
  * Input: mkdir foo
66
- * Output: Creates directory 'foo'
66
+ * Output: Create directory 'foo'
67
67
  */
68
68
  description?: string;
69
69
  /**
package/sdk.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms).
4
4
 
5
- // Version: 1.0.98
5
+ // Version: 1.0.102
6
6
 
7
7
  // Want to see the unminified source? We're hiring!
8
8
  // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
@@ -6201,6 +6201,10 @@ var require_ajv = __commonJS((exports, module) => {
6201
6201
  function noop() {}
6202
6202
  });
6203
6203
 
6204
+ // src/entrypoints/sdk.ts
6205
+ import { join as join2 } from "path";
6206
+ import { fileURLToPath as fileURLToPath2 } from "url";
6207
+
6204
6208
  // src/utils/abortController.ts
6205
6209
  import { setMaxListeners } from "events";
6206
6210
  var DEFAULT_MAX_LISTENERS = 50;
@@ -6336,9 +6340,11 @@ class ProcessTransport {
6336
6340
  exitListeners = [];
6337
6341
  processExitHandler;
6338
6342
  abortHandler;
6343
+ isStreaming;
6339
6344
  constructor(options) {
6340
6345
  this.options = options;
6341
6346
  this.abortController = options.abortController || createAbortController();
6347
+ this.isStreaming = typeof options.prompt !== "string";
6342
6348
  this.initialize();
6343
6349
  }
6344
6350
  initialize() {
@@ -6437,15 +6443,11 @@ class ProcessTransport {
6437
6443
  const claudeCodePath = pathToClaudeCodeExecutable || this.getDefaultExecutablePath();
6438
6444
  const fs2 = getFsImplementation();
6439
6445
  if (!fs2.existsSync(claudeCodePath)) {
6440
- const errorMessage = isNativeBinary(claudeCodePath) ? `Claude Code native binary not found at ${claudeCodePath}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.` : `Claude Code executable not found at ${claudeCodePath}. Is options.pathToClaudeCodeExecutable set?`;
6441
- throw new ReferenceError(errorMessage);
6446
+ throw new Error(`Claude Code executable not found at ${claudeCodePath}. Is options.pathToClaudeCodeExecutable set?`);
6442
6447
  }
6443
- const isNative = isNativeBinary(claudeCodePath);
6444
- const spawnCommand = isNative ? claudeCodePath : executable;
6445
- const spawnArgs = isNative ? args : [...executableArgs, claudeCodePath, ...args];
6446
- this.logDebug(isNative ? `Spawning Claude Code native binary: ${claudeCodePath} ${args.join(" ")}` : `Spawning Claude Code process: ${executable} ${[...executableArgs, claudeCodePath, ...args].join(" ")}`);
6448
+ this.logDebug(`Spawning Claude Code process: ${executable} ${[...executableArgs, claudeCodePath, ...args].join(" ")}`);
6447
6449
  const stderrMode = env.DEBUG || stderr ? "pipe" : "ignore";
6448
- this.child = spawn(spawnCommand, spawnArgs, {
6450
+ this.child = spawn(executable, [...executableArgs, claudeCodePath, ...args], {
6449
6451
  cwd,
6450
6452
  stdio: ["pipe", "pipe", stderrMode],
6451
6453
  signal: this.abortController.signal,
@@ -6664,10 +6666,6 @@ class ProcessTransport {
6664
6666
  });
6665
6667
  }
6666
6668
  }
6667
- function isNativeBinary(executablePath) {
6668
- const jsExtensions = [".js", ".mjs", ".tsx", ".ts", ".jsx"];
6669
- return !jsExtensions.some((ext) => executablePath.endsWith(ext));
6670
- }
6671
6669
 
6672
6670
  // src/utils/stream.ts
6673
6671
  class Stream {
@@ -13998,6 +13996,11 @@ function query({
13998
13996
  if (!env.CLAUDE_CODE_ENTRYPOINT) {
13999
13997
  env.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
14000
13998
  }
13999
+ if (pathToClaudeCodeExecutable === undefined) {
14000
+ const filename = fileURLToPath2(import.meta.url);
14001
+ const dirname = join2(filename, "..");
14002
+ pathToClaudeCodeExecutable = join2(dirname, "cli.js");
14003
+ }
14001
14004
  const allMcpServers = {};
14002
14005
  const sdkMcpServers = new Map;
14003
14006
  if (mcpServers) {
Binary file