@anthropic-ai/claude-agent-sdk 0.1.14 → 0.1.16

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 +1642 -1613
  2. package/package.json +2 -2
  3. package/sdk.mjs +2 -2
  4. package/sdkTypes.d.ts +16 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "engines": {
@@ -38,4 +38,4 @@
38
38
  "@img/sharp-linux-x64": "^0.33.5",
39
39
  "@img/sharp-win32-x64": "^0.33.5"
40
40
  }
41
- }
41
+ }
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.14
4
+ // Version: 0.1.16
5
5
 
6
6
  // Want to see the unminified source? We're hiring!
7
7
  // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
@@ -14825,7 +14825,7 @@ function query({
14825
14825
  const dirname2 = join3(filename, "..");
14826
14826
  pathToClaudeCodeExecutable = join3(dirname2, "cli.js");
14827
14827
  }
14828
- process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.14";
14828
+ process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.16";
14829
14829
  return createSharedQuery({
14830
14830
  prompt,
14831
14831
  options: {
package/sdkTypes.d.ts CHANGED
@@ -227,7 +227,9 @@ export type Options = {
227
227
  customSystemPrompt?: string;
228
228
  cwd?: string;
229
229
  disallowedTools?: string[];
230
- env?: Dict<string>;
230
+ env?: {
231
+ [envVar: string]: string | undefined;
232
+ };
231
233
  executable?: 'bun' | 'deno' | 'node';
232
234
  executableArgs?: string[];
233
235
  extraArgs?: Record<string, string | null>;
@@ -352,6 +354,7 @@ export type SDKSystemMessage = SDKMessageBase & {
352
354
  subtype: 'init';
353
355
  agents?: string[];
354
356
  apiKeySource: ApiKeySource;
357
+ claude_code_version: string;
355
358
  cwd: string;
356
359
  tools: string[];
357
360
  mcp_servers: {
@@ -376,7 +379,18 @@ export type SDKCompactBoundaryMessage = SDKMessageBase & {
376
379
  pre_tokens: number;
377
380
  };
378
381
  };
379
- export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage;
382
+ export type SDKHookResponseMessage = SDKMessageBase & {
383
+ type: 'system';
384
+ subtype: 'hook_response';
385
+ hook_name: string;
386
+ hook_event: string;
387
+ tool_name?: string;
388
+ response: SyncHookJSONOutput;
389
+ stdout: string;
390
+ stderr: string;
391
+ exit_code?: number;
392
+ };
393
+ export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKHookResponseMessage;
380
394
  export interface Query extends AsyncGenerator<SDKMessage, void> {
381
395
  /**
382
396
  * Control Requests