@anthropic-ai/claude-agent-sdk 0.1.75 → 0.1.77

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.
@@ -4,32 +4,18 @@
4
4
  * This file is the single source of truth for sandbox configuration types.
5
5
  * Both the SDK and the settings validation import from here.
6
6
  */
7
- import { z } from 'zod';
7
+ import { z } from 'zod/v4';
8
8
  /**
9
9
  * Network configuration schema for sandbox.
10
10
  */
11
11
  export declare const SandboxNetworkConfigSchema: z.ZodOptional<z.ZodObject<{
12
- allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
- allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
14
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
15
15
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
16
16
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
17
17
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
18
- }, "strip", z.ZodTypeAny, {
19
- allowedDomains?: string[];
20
- allowUnixSockets?: string[];
21
- allowAllUnixSockets?: boolean;
22
- allowLocalBinding?: boolean;
23
- httpProxyPort?: number;
24
- socksProxyPort?: number;
25
- }, {
26
- allowedDomains?: string[];
27
- allowUnixSockets?: string[];
28
- allowAllUnixSockets?: boolean;
29
- allowLocalBinding?: boolean;
30
- httpProxyPort?: number;
31
- socksProxyPort?: number;
32
- }>>;
18
+ }, z.core.$strip>>;
33
19
  /**
34
20
  * Sandbox settings schema.
35
21
  */
@@ -38,119 +24,21 @@ export declare const SandboxSettingsSchema: z.ZodObject<{
38
24
  autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
39
25
  allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
40
26
  network: z.ZodOptional<z.ZodObject<{
41
- allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
- allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
27
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
+ allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
29
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
44
30
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
45
31
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
46
32
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
47
- }, "strip", z.ZodTypeAny, {
48
- allowedDomains?: string[];
49
- allowUnixSockets?: string[];
50
- allowAllUnixSockets?: boolean;
51
- allowLocalBinding?: boolean;
52
- httpProxyPort?: number;
53
- socksProxyPort?: number;
54
- }, {
55
- allowedDomains?: string[];
56
- allowUnixSockets?: string[];
57
- allowAllUnixSockets?: boolean;
58
- allowLocalBinding?: boolean;
59
- httpProxyPort?: number;
60
- socksProxyPort?: number;
61
- }>>;
62
- ignoreViolations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
33
+ }, z.core.$strip>>;
34
+ ignoreViolations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
63
35
  enableWeakerNestedSandbox: z.ZodOptional<z.ZodBoolean>;
64
- excludedCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ excludedCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
37
  ripgrep: z.ZodOptional<z.ZodObject<{
66
38
  command: z.ZodString;
67
- args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
- }, "strip", z.ZodTypeAny, {
69
- command?: string;
70
- args?: string[];
71
- }, {
72
- command?: string;
73
- args?: string[];
74
- }>>;
75
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
76
- enabled: z.ZodOptional<z.ZodBoolean>;
77
- autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
78
- allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
79
- network: z.ZodOptional<z.ZodObject<{
80
- allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
81
- allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
82
- allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
83
- allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
84
- httpProxyPort: z.ZodOptional<z.ZodNumber>;
85
- socksProxyPort: z.ZodOptional<z.ZodNumber>;
86
- }, "strip", z.ZodTypeAny, {
87
- allowedDomains?: string[];
88
- allowUnixSockets?: string[];
89
- allowAllUnixSockets?: boolean;
90
- allowLocalBinding?: boolean;
91
- httpProxyPort?: number;
92
- socksProxyPort?: number;
93
- }, {
94
- allowedDomains?: string[];
95
- allowUnixSockets?: string[];
96
- allowAllUnixSockets?: boolean;
97
- allowLocalBinding?: boolean;
98
- httpProxyPort?: number;
99
- socksProxyPort?: number;
100
- }>>;
101
- ignoreViolations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
102
- enableWeakerNestedSandbox: z.ZodOptional<z.ZodBoolean>;
103
- excludedCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
104
- ripgrep: z.ZodOptional<z.ZodObject<{
105
- command: z.ZodString;
106
- args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
107
- }, "strip", z.ZodTypeAny, {
108
- command?: string;
109
- args?: string[];
110
- }, {
111
- command?: string;
112
- args?: string[];
113
- }>>;
114
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
115
- enabled: z.ZodOptional<z.ZodBoolean>;
116
- autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
117
- allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
118
- network: z.ZodOptional<z.ZodObject<{
119
- allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
- allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
121
- allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
122
- allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
123
- httpProxyPort: z.ZodOptional<z.ZodNumber>;
124
- socksProxyPort: z.ZodOptional<z.ZodNumber>;
125
- }, "strip", z.ZodTypeAny, {
126
- allowedDomains?: string[];
127
- allowUnixSockets?: string[];
128
- allowAllUnixSockets?: boolean;
129
- allowLocalBinding?: boolean;
130
- httpProxyPort?: number;
131
- socksProxyPort?: number;
132
- }, {
133
- allowedDomains?: string[];
134
- allowUnixSockets?: string[];
135
- allowAllUnixSockets?: boolean;
136
- allowLocalBinding?: boolean;
137
- httpProxyPort?: number;
138
- socksProxyPort?: number;
139
- }>>;
140
- ignoreViolations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
141
- enableWeakerNestedSandbox: z.ZodOptional<z.ZodBoolean>;
142
- excludedCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
143
- ripgrep: z.ZodOptional<z.ZodObject<{
144
- command: z.ZodString;
145
- args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
- }, "strip", z.ZodTypeAny, {
147
- command?: string;
148
- args?: string[];
149
- }, {
150
- command?: string;
151
- args?: string[];
152
- }>>;
153
- }, z.ZodTypeAny, "passthrough">>;
39
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$loose>;
154
42
  export type SandboxSettings = z.infer<typeof SandboxSettingsSchema>;
155
43
  export type SandboxNetworkConfig = NonNullable<z.infer<typeof SandboxNetworkConfigSchema>>;
156
44
  export type SandboxIgnoreViolations = NonNullable<SandboxSettings['ignoreViolations']>;
@@ -1,5 +1,12 @@
1
- import { type AccountInfo, type PermissionMode, type SDKMessage, type SDKUserMessage, type HookInput, type HookEvent, type PermissionUpdate, type ModelInfo, type SlashCommand, type AgentDefinition, type McpServerConfigForProcessTransport } from './agentSdkTypes.js';
2
1
  import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
2
+ export * from './coreTypes.js';
3
+ import type { HookEvent, HookInput, PermissionMode, PermissionUpdate, AgentDefinition, SlashCommand, ModelInfo, AccountInfo, McpServerConfigForProcessTransport, SDKMessage, SDKUserMessage } from './coreTypes.js';
4
+ export type SDKHookCallbackMatcher = {
5
+ matcher?: string;
6
+ hookCallbackIds: string[];
7
+ /** Timeout in seconds for all hooks in this matcher */
8
+ timeout?: number;
9
+ };
3
10
  export type SDKControlInitializeRequest = {
4
11
  subtype: 'initialize';
5
12
  hooks?: Partial<Record<HookEvent, SDKHookCallbackMatcher[]>>;
@@ -47,12 +54,14 @@ export type SDKControlMcpStatusRequest = {
47
54
  export type SDKControlRewindFilesRequest = {
48
55
  subtype: 'rewind_files';
49
56
  user_message_id: string;
50
- };
51
- export type SDKHookCallbackMatcher = {
52
- matcher?: string;
53
- hookCallbackIds: string[];
54
- /** Timeout in seconds for all hooks in this matcher */
55
- timeout?: number;
57
+ dry_run?: boolean;
58
+ };
59
+ export type SDKControlRewindFilesResponse = {
60
+ canRewind: boolean;
61
+ error?: string;
62
+ filesChanged?: string[];
63
+ insertions?: number;
64
+ deletions?: number;
56
65
  };
57
66
  export type SDKHookCallbackRequest = {
58
67
  subtype: 'hook_callback';