@anthropic-ai/claude-agent-sdk 0.1.61 → 0.1.63

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-agent-sdk",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "engines": {
package/resvg.wasm ADDED
Binary file
package/sandboxTypes.d.ts CHANGED
@@ -9,18 +9,21 @@ import { z } from 'zod';
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">>;
12
13
  allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
14
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
14
15
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
15
16
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
16
17
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
17
18
  }, "strip", z.ZodTypeAny, {
19
+ allowedDomains?: string[];
18
20
  allowUnixSockets?: string[];
19
21
  allowAllUnixSockets?: boolean;
20
22
  allowLocalBinding?: boolean;
21
23
  httpProxyPort?: number;
22
24
  socksProxyPort?: number;
23
25
  }, {
26
+ allowedDomains?: string[];
24
27
  allowUnixSockets?: string[];
25
28
  allowAllUnixSockets?: boolean;
26
29
  allowLocalBinding?: boolean;
@@ -35,18 +38,21 @@ export declare const SandboxSettingsSchema: z.ZodObject<{
35
38
  autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
36
39
  allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
37
40
  network: z.ZodOptional<z.ZodObject<{
41
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
42
  allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
43
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
40
44
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
41
45
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
42
46
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
43
47
  }, "strip", z.ZodTypeAny, {
48
+ allowedDomains?: string[];
44
49
  allowUnixSockets?: string[];
45
50
  allowAllUnixSockets?: boolean;
46
51
  allowLocalBinding?: boolean;
47
52
  httpProxyPort?: number;
48
53
  socksProxyPort?: number;
49
54
  }, {
55
+ allowedDomains?: string[];
50
56
  allowUnixSockets?: string[];
51
57
  allowAllUnixSockets?: boolean;
52
58
  allowLocalBinding?: boolean;
@@ -71,18 +77,21 @@ export declare const SandboxSettingsSchema: z.ZodObject<{
71
77
  autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
72
78
  allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
73
79
  network: z.ZodOptional<z.ZodObject<{
80
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
81
  allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
82
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
76
83
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
77
84
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
78
85
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
79
86
  }, "strip", z.ZodTypeAny, {
87
+ allowedDomains?: string[];
80
88
  allowUnixSockets?: string[];
81
89
  allowAllUnixSockets?: boolean;
82
90
  allowLocalBinding?: boolean;
83
91
  httpProxyPort?: number;
84
92
  socksProxyPort?: number;
85
93
  }, {
94
+ allowedDomains?: string[];
86
95
  allowUnixSockets?: string[];
87
96
  allowAllUnixSockets?: boolean;
88
97
  allowLocalBinding?: boolean;
@@ -107,18 +116,21 @@ export declare const SandboxSettingsSchema: z.ZodObject<{
107
116
  autoAllowBashIfSandboxed: z.ZodOptional<z.ZodBoolean>;
108
117
  allowUnsandboxedCommands: z.ZodOptional<z.ZodBoolean>;
109
118
  network: z.ZodOptional<z.ZodObject<{
119
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
110
120
  allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
111
121
  allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
112
122
  allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
113
123
  httpProxyPort: z.ZodOptional<z.ZodNumber>;
114
124
  socksProxyPort: z.ZodOptional<z.ZodNumber>;
115
125
  }, "strip", z.ZodTypeAny, {
126
+ allowedDomains?: string[];
116
127
  allowUnixSockets?: string[];
117
128
  allowAllUnixSockets?: boolean;
118
129
  allowLocalBinding?: boolean;
119
130
  httpProxyPort?: number;
120
131
  socksProxyPort?: number;
121
132
  }, {
133
+ allowedDomains?: string[];
122
134
  allowUnixSockets?: string[];
123
135
  allowAllUnixSockets?: boolean;
124
136
  allowLocalBinding?: boolean;
package/sdk.d.ts CHANGED
@@ -570,6 +570,13 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
570
570
  * @returns Account information including email, organization, and subscription type
571
571
  */
572
572
  accountInfo(): Promise<AccountInfo>;
573
+ /**
574
+ * Rewind tracked files to their state at a specific user message.
575
+ * Requires file checkpointing to be enabled via the `enableFileCheckpointing` option.
576
+ *
577
+ * @param userMessageId - UUID of the user message to rewind to
578
+ */
579
+ rewindFiles(userMessageId: string): Promise<void>;
573
580
  /**
574
581
  * Stream input messages to the query.
575
582
  * Used internally for multi-turn conversations.
@@ -747,6 +754,15 @@ export type Options = {
747
754
  * Fallback model to use if the primary model fails or is unavailable.
748
755
  */
749
756
  fallbackModel?: string;
757
+ /**
758
+ * Enable file checkpointing to track file changes during the session.
759
+ * When enabled, files can be rewound to their state at any user message
760
+ * using `Query.rewindFiles()`.
761
+ *
762
+ * File checkpointing creates backups of files before they are modified,
763
+ * allowing you to restore them to previous states.
764
+ */
765
+ enableFileCheckpointing?: boolean;
750
766
  /**
751
767
  * When true, resumed sessions will fork to a new session ID rather than
752
768
  * continuing the previous session. Use with `resume`.
@@ -773,6 +789,14 @@ export type Options = {
773
789
  * ```
774
790
  */
775
791
  hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
792
+ /**
793
+ * When false, disables session persistence to disk. Sessions will not be
794
+ * saved to ~/.claude/projects/ and cannot be resumed later. Useful for
795
+ * ephemeral or automated workflows where session history is not needed.
796
+ *
797
+ * @default true
798
+ */
799
+ persistSession?: boolean;
776
800
  /**
777
801
  * Include partial/streaming message events in the output.
778
802
  * When true, `SDKPartialAssistantMessage` events will be emitted during streaming.