@anthropic-ai/claude-code 1.0.95 → 1.0.98

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.95",
3
+ "version": "1.0.98",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "bin": {
package/sdk-tools.d.ts CHANGED
@@ -21,7 +21,6 @@ export type ToolInputSchemas =
21
21
  | GrepInput
22
22
  | KillShellInput
23
23
  | ListMcpResourcesInput
24
- | LsInput
25
24
  | McpInput
26
25
  | NotebookEditInput
27
26
  | ReadMcpResourceInput
@@ -251,16 +250,6 @@ export interface ListMcpResourcesInput {
251
250
  */
252
251
  server?: string;
253
252
  }
254
- export interface LsInput {
255
- /**
256
- * The absolute path to the directory to list (must be absolute, not relative)
257
- */
258
- path: string;
259
- /**
260
- * List of glob patterns to ignore
261
- */
262
- ignore?: string[];
263
- }
264
253
  export interface McpInput {
265
254
  [k: string]: unknown;
266
255
  }
package/sdk.d.ts CHANGED
@@ -70,6 +70,7 @@ export type PermissionResult = {
70
70
  } | {
71
71
  behavior: 'deny';
72
72
  message: string;
73
+ interrupt?: boolean;
73
74
  };
74
75
  export type PermissionRuleValue = {
75
76
  toolName: string;
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.95
5
+ // Version: 1.0.98
6
6
 
7
7
  // Want to see the unminified source? We're hiring!
8
8
  // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
@@ -6201,10 +6201,6 @@ 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
-
6208
6204
  // src/utils/abortController.ts
6209
6205
  import { setMaxListeners } from "events";
6210
6206
  var DEFAULT_MAX_LISTENERS = 50;
@@ -6340,11 +6336,9 @@ class ProcessTransport {
6340
6336
  exitListeners = [];
6341
6337
  processExitHandler;
6342
6338
  abortHandler;
6343
- isStreaming;
6344
6339
  constructor(options) {
6345
6340
  this.options = options;
6346
6341
  this.abortController = options.abortController || createAbortController();
6347
- this.isStreaming = typeof options.prompt !== "string";
6348
6342
  this.initialize();
6349
6343
  }
6350
6344
  initialize() {
@@ -6443,11 +6437,15 @@ class ProcessTransport {
6443
6437
  const claudeCodePath = pathToClaudeCodeExecutable || this.getDefaultExecutablePath();
6444
6438
  const fs2 = getFsImplementation();
6445
6439
  if (!fs2.existsSync(claudeCodePath)) {
6446
- throw new Error(`Claude Code executable not found at ${claudeCodePath}. Is options.pathToClaudeCodeExecutable set?`);
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);
6447
6442
  }
6448
- this.logDebug(`Spawning Claude Code process: ${executable} ${[...executableArgs, claudeCodePath, ...args].join(" ")}`);
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(" ")}`);
6449
6447
  const stderrMode = env.DEBUG || stderr ? "pipe" : "ignore";
6450
- this.child = spawn(executable, [...executableArgs, claudeCodePath, ...args], {
6448
+ this.child = spawn(spawnCommand, spawnArgs, {
6451
6449
  cwd,
6452
6450
  stdio: ["pipe", "pipe", stderrMode],
6453
6451
  signal: this.abortController.signal,
@@ -6666,6 +6664,10 @@ class ProcessTransport {
6666
6664
  });
6667
6665
  }
6668
6666
  }
6667
+ function isNativeBinary(executablePath) {
6668
+ const jsExtensions = [".js", ".mjs", ".tsx", ".ts", ".jsx"];
6669
+ return !jsExtensions.some((ext) => executablePath.endsWith(ext));
6670
+ }
6669
6671
 
6670
6672
  // src/utils/stream.ts
6671
6673
  class Stream {
@@ -13996,11 +13998,6 @@ function query({
13996
13998
  if (!env.CLAUDE_CODE_ENTRYPOINT) {
13997
13999
  env.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
13998
14000
  }
13999
- if (pathToClaudeCodeExecutable === undefined) {
14000
- const filename = fileURLToPath2(import.meta.url);
14001
- const dirname = join2(filename, "..");
14002
- pathToClaudeCodeExecutable = join2(dirname, "cli.js");
14003
- }
14004
14001
  const allMcpServers = {};
14005
14002
  const sdkMcpServers = new Map;
14006
14003
  if (mcpServers) {
Binary file