@evolvingmachines/sdk 0.0.21 → 0.0.22

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/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import { EventEmitter } from 'events';
4
- export { E2BProvider } from '@evolvingmachines/e2b';
5
- export { DaytonaProvider } from '@evolvingmachines/daytona';
6
- export { ModalProvider } from '@evolvingmachines/modal';
4
+ export { E2BProvider, createE2BProvider } from '@evolvingmachines/e2b';
5
+ export { DaytonaProvider, createDaytonaProvider } from '@evolvingmachines/daytona';
6
+ export { ModalProvider, createModalProvider } from '@evolvingmachines/modal';
7
7
 
8
8
  /**
9
9
  * ACP-inspired output types for unified agent event streaming.
@@ -532,6 +532,8 @@ interface AgentOptions {
532
532
  * Set via withComposio() - provides access to 1000+ tools
533
533
  */
534
534
  composio?: ComposioSetup;
535
+ /** Resolved storage configuration (set via Evolve.withStorage()) */
536
+ storage?: ResolvedStorageConfig;
535
537
  }
536
538
  /** Options for run() */
537
539
  interface RunOptions {
@@ -541,6 +543,10 @@ interface RunOptions {
541
543
  timeoutMs?: number;
542
544
  /** Run in background (returns immediately, process continues) */
543
545
  background?: boolean;
546
+ /** Restore from checkpoint ID or "latest" before running (requires .withStorage()) */
547
+ from?: string;
548
+ /** Optional comment for the auto-checkpoint created after this run */
549
+ checkpointComment?: string;
544
550
  }
545
551
  /** Options for executeCommand() */
546
552
  interface ExecuteCommandOptions {
@@ -582,6 +588,8 @@ interface AgentResponse {
582
588
  stdout: string;
583
589
  /** Standard error */
584
590
  stderr: string;
591
+ /** Checkpoint info if storage configured and run succeeded (undefined otherwise) */
592
+ checkpoint?: CheckpointInfo;
585
593
  }
586
594
  /** Result from getOutputFiles() with optional schema validation */
587
595
  interface OutputResult<T = unknown> {
@@ -666,6 +674,80 @@ interface ComposioSetup {
666
674
  /** Optional Composio configuration */
667
675
  config?: ComposioConfig;
668
676
  }
677
+ /**
678
+ * Storage configuration for .withStorage()
679
+ *
680
+ * BYOK mode: provide url (e.g., "s3://my-bucket/prefix/")
681
+ * Gateway mode: omit url (uses Evolve-managed storage)
682
+ *
683
+ * @example
684
+ * // BYOK — user's own S3 bucket
685
+ * .withStorage({ url: "s3://my-bucket/agent-snapshots/" })
686
+ *
687
+ * // BYOK — Cloudflare R2
688
+ * .withStorage({ url: "s3://my-bucket/prefix/", endpoint: "https://acct.r2.cloudflarestorage.com" })
689
+ *
690
+ * // Gateway — Evolve-managed storage
691
+ * .withStorage()
692
+ */
693
+ interface StorageConfig {
694
+ /** S3 URL: "s3://bucket/prefix" or "https://endpoint/bucket/prefix" */
695
+ url?: string;
696
+ /** Explicit bucket name (overrides URL parsing) */
697
+ bucket?: string;
698
+ /** Key prefix (overrides URL parsing) */
699
+ prefix?: string;
700
+ /** AWS region (default from env or us-east-1) */
701
+ region?: string;
702
+ /** Custom S3 endpoint (R2, MinIO, GCS) */
703
+ endpoint?: string;
704
+ /** Explicit credentials (default: AWS SDK credential chain) */
705
+ credentials?: {
706
+ accessKeyId: string;
707
+ secretAccessKey: string;
708
+ };
709
+ }
710
+ /** Resolved storage configuration (internal) */
711
+ interface ResolvedStorageConfig {
712
+ bucket: string;
713
+ prefix: string;
714
+ region: string;
715
+ endpoint?: string;
716
+ credentials?: {
717
+ accessKeyId: string;
718
+ secretAccessKey: string;
719
+ };
720
+ mode: "byok" | "gateway";
721
+ gatewayUrl?: string;
722
+ gatewayApiKey?: string;
723
+ }
724
+ /**
725
+ * Checkpoint info returned after a successful run
726
+ *
727
+ * Pass `checkpoint.id` as `from` to restore into a fresh sandbox.
728
+ */
729
+ interface CheckpointInfo {
730
+ /** Checkpoint ID — pass as `from` to restore */
731
+ id: string;
732
+ /** SHA-256 of tar.gz — integrity verification */
733
+ hash: string;
734
+ /** Session tag at checkpoint time — lineage tracking */
735
+ tag: string;
736
+ /** ISO 8601 timestamp */
737
+ timestamp: string;
738
+ /** Archive size in bytes */
739
+ sizeBytes?: number;
740
+ /** Agent type that produced this checkpoint */
741
+ agentType?: string;
742
+ /** Model that produced this checkpoint */
743
+ model?: string;
744
+ /** Workspace mode used when checkpoint was created */
745
+ workspaceMode?: string;
746
+ /** Parent checkpoint ID — the checkpoint this was restored from (lineage tracking) */
747
+ parentId?: string;
748
+ /** User-provided label for this checkpoint */
749
+ comment?: string;
750
+ }
669
751
 
670
752
  /**
671
753
  * Composio Auth Helpers
@@ -774,6 +856,8 @@ declare class Agent {
774
856
  private sandboxState;
775
857
  private agentState;
776
858
  private readonly skills?;
859
+ private readonly storage?;
860
+ private lastCheckpointId?;
777
861
  private readonly zodSchema?;
778
862
  private readonly jsonSchema?;
779
863
  private readonly schemaOptions?;
@@ -802,6 +886,9 @@ declare class Agent {
802
886
  private setupAgentAuth;
803
887
  /**
804
888
  * Setup workspace structure and files
889
+ *
890
+ * @param opts.skipSystemPrompt - When true, skip writing the system prompt file.
891
+ * Used on restore from checkpoint: the tar already contains the correct file.
805
892
  */
806
893
  private setupWorkspace;
807
894
  /**
@@ -850,6 +937,16 @@ declare class Agent {
850
937
  * @param recursive - Include files in subdirectories (default: false)
851
938
  */
852
939
  getOutputFiles<T = unknown>(recursive?: boolean): Promise<OutputResult<T>>;
940
+ /**
941
+ * Create an explicit checkpoint of the current sandbox state.
942
+ *
943
+ * Requires an active sandbox (call run() first).
944
+ *
945
+ * @param options.comment - Optional label for this checkpoint
946
+ */
947
+ checkpoint(options?: {
948
+ comment?: string;
949
+ }): Promise<CheckpointInfo>;
853
950
  /**
854
951
  * Get current session (sandbox ID)
855
952
  */
@@ -1075,6 +1172,8 @@ interface EvolveConfig {
1075
1172
  observability?: Record<string, unknown>;
1076
1173
  /** Composio user ID and config */
1077
1174
  composio?: ComposioSetup;
1175
+ /** Storage configuration for checkpointing */
1176
+ storage?: StorageConfig;
1078
1177
  }
1079
1178
  /**
1080
1179
  * Evolve orchestrator with builder pattern
@@ -1218,6 +1317,23 @@ declare class Evolve extends EventEmitter {
1218
1317
  * })
1219
1318
  */
1220
1319
  withComposio(userId: string, config?: ComposioConfig): this;
1320
+ /**
1321
+ * Configure storage for checkpoint persistence
1322
+ *
1323
+ * BYOK mode: provide URL to your S3-compatible bucket.
1324
+ * Gateway mode: omit config (uses Evolve-managed storage, requires EVOLVE_API_KEY).
1325
+ *
1326
+ * @example
1327
+ * // BYOK — user's own S3 bucket
1328
+ * kit.withStorage({ url: "s3://my-bucket/agent-snapshots/" })
1329
+ *
1330
+ * // BYOK — Cloudflare R2
1331
+ * kit.withStorage({ url: "s3://my-bucket/prefix/", endpoint: "https://acct.r2.cloudflarestorage.com" })
1332
+ *
1333
+ * // Gateway — Evolve-managed storage
1334
+ * kit.withStorage()
1335
+ */
1336
+ withStorage(config?: StorageConfig): this;
1221
1337
  /**
1222
1338
  * Static helpers for Composio auth management
1223
1339
  *
@@ -1255,11 +1371,15 @@ declare class Evolve extends EventEmitter {
1255
1371
  private emitLifecycleFromStatus;
1256
1372
  /**
1257
1373
  * Run agent with prompt
1374
+ *
1375
+ * @param from - Restore from checkpoint ID before running (requires .withStorage())
1258
1376
  */
1259
- run({ prompt, timeoutMs, background, }: {
1377
+ run({ prompt, timeoutMs, background, from, checkpointComment, }: {
1260
1378
  prompt: string;
1261
1379
  timeoutMs?: number;
1262
1380
  background?: boolean;
1381
+ from?: string;
1382
+ checkpointComment?: string;
1263
1383
  }): Promise<AgentResponse>;
1264
1384
  /**
1265
1385
  * Execute arbitrary command in sandbox
@@ -1286,6 +1406,28 @@ declare class Evolve extends EventEmitter {
1286
1406
  * @param recursive - Include files in subdirectories (default: false)
1287
1407
  */
1288
1408
  getOutputFiles<T = unknown>(recursive?: boolean): Promise<OutputResult<T>>;
1409
+ /**
1410
+ * Create an explicit checkpoint of the current sandbox state.
1411
+ *
1412
+ * Requires a prior run() call (needs an active sandbox to snapshot).
1413
+ *
1414
+ * @param options.comment - Optional label for this checkpoint
1415
+ */
1416
+ checkpoint(options?: {
1417
+ comment?: string;
1418
+ }): Promise<CheckpointInfo>;
1419
+ /**
1420
+ * List checkpoints (requires .withStorage()).
1421
+ *
1422
+ * Does not require an agent or sandbox — only storage configuration.
1423
+ *
1424
+ * @param options.limit - Maximum number of checkpoints to return
1425
+ * @param options.tag - Filter by session tag (gateway mode: server-side, BYOK: post-filter)
1426
+ */
1427
+ listCheckpoints(options?: {
1428
+ limit?: number;
1429
+ tag?: string;
1430
+ }): Promise<CheckpointInfo[]>;
1289
1431
  /**
1290
1432
  * Get current session (sandbox ID)
1291
1433
  */
@@ -2462,4 +2604,38 @@ declare function readLocalDir(localPath: string, recursive?: boolean): FileMap;
2462
2604
  */
2463
2605
  declare function saveLocalDir(localPath: string, files: FileMap): void;
2464
2606
 
2465
- export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, saveLocalDir, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
2607
+ /**
2608
+ * Storage & Checkpointing Module
2609
+ *
2610
+ * Provides durable persistence for agent workspaces beyond sandbox lifetime.
2611
+ * Supports BYOK (user's S3 bucket) and Gateway (Evolve-managed) modes.
2612
+ *
2613
+ * Evidence: storage-checkpointing plan v2.2
2614
+ */
2615
+
2616
+ /**
2617
+ * Resolve storage configuration from user input.
2618
+ *
2619
+ * BYOK mode: URL provided → parse into bucket/prefix, use S3 client directly
2620
+ * Gateway mode: no URL → use dashboard API endpoints
2621
+ */
2622
+ declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2623
+ /**
2624
+ * List checkpoints (standalone — no Evolve instance needed).
2625
+ *
2626
+ * BYOK mode: reads directly from S3.
2627
+ * Gateway mode: reads EVOLVE_API_KEY from env, calls dashboard API.
2628
+ *
2629
+ * @example
2630
+ * // BYOK
2631
+ * const all = await listCheckpoints({ url: "s3://my-bucket/project/" });
2632
+ *
2633
+ * // Gateway
2634
+ * const all = await listCheckpoints({});
2635
+ */
2636
+ declare function listCheckpoints(config: StorageConfig, options?: {
2637
+ limit?: number;
2638
+ tag?: string;
2639
+ }): Promise<CheckpointInfo[]>;
2640
+
2641
+ export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type CheckpointInfo, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type ResolvedStorageConfig, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageConfig, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, listCheckpoints, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import { EventEmitter } from 'events';
4
- export { E2BProvider } from '@evolvingmachines/e2b';
5
- export { DaytonaProvider } from '@evolvingmachines/daytona';
6
- export { ModalProvider } from '@evolvingmachines/modal';
4
+ export { E2BProvider, createE2BProvider } from '@evolvingmachines/e2b';
5
+ export { DaytonaProvider, createDaytonaProvider } from '@evolvingmachines/daytona';
6
+ export { ModalProvider, createModalProvider } from '@evolvingmachines/modal';
7
7
 
8
8
  /**
9
9
  * ACP-inspired output types for unified agent event streaming.
@@ -532,6 +532,8 @@ interface AgentOptions {
532
532
  * Set via withComposio() - provides access to 1000+ tools
533
533
  */
534
534
  composio?: ComposioSetup;
535
+ /** Resolved storage configuration (set via Evolve.withStorage()) */
536
+ storage?: ResolvedStorageConfig;
535
537
  }
536
538
  /** Options for run() */
537
539
  interface RunOptions {
@@ -541,6 +543,10 @@ interface RunOptions {
541
543
  timeoutMs?: number;
542
544
  /** Run in background (returns immediately, process continues) */
543
545
  background?: boolean;
546
+ /** Restore from checkpoint ID or "latest" before running (requires .withStorage()) */
547
+ from?: string;
548
+ /** Optional comment for the auto-checkpoint created after this run */
549
+ checkpointComment?: string;
544
550
  }
545
551
  /** Options for executeCommand() */
546
552
  interface ExecuteCommandOptions {
@@ -582,6 +588,8 @@ interface AgentResponse {
582
588
  stdout: string;
583
589
  /** Standard error */
584
590
  stderr: string;
591
+ /** Checkpoint info if storage configured and run succeeded (undefined otherwise) */
592
+ checkpoint?: CheckpointInfo;
585
593
  }
586
594
  /** Result from getOutputFiles() with optional schema validation */
587
595
  interface OutputResult<T = unknown> {
@@ -666,6 +674,80 @@ interface ComposioSetup {
666
674
  /** Optional Composio configuration */
667
675
  config?: ComposioConfig;
668
676
  }
677
+ /**
678
+ * Storage configuration for .withStorage()
679
+ *
680
+ * BYOK mode: provide url (e.g., "s3://my-bucket/prefix/")
681
+ * Gateway mode: omit url (uses Evolve-managed storage)
682
+ *
683
+ * @example
684
+ * // BYOK — user's own S3 bucket
685
+ * .withStorage({ url: "s3://my-bucket/agent-snapshots/" })
686
+ *
687
+ * // BYOK — Cloudflare R2
688
+ * .withStorage({ url: "s3://my-bucket/prefix/", endpoint: "https://acct.r2.cloudflarestorage.com" })
689
+ *
690
+ * // Gateway — Evolve-managed storage
691
+ * .withStorage()
692
+ */
693
+ interface StorageConfig {
694
+ /** S3 URL: "s3://bucket/prefix" or "https://endpoint/bucket/prefix" */
695
+ url?: string;
696
+ /** Explicit bucket name (overrides URL parsing) */
697
+ bucket?: string;
698
+ /** Key prefix (overrides URL parsing) */
699
+ prefix?: string;
700
+ /** AWS region (default from env or us-east-1) */
701
+ region?: string;
702
+ /** Custom S3 endpoint (R2, MinIO, GCS) */
703
+ endpoint?: string;
704
+ /** Explicit credentials (default: AWS SDK credential chain) */
705
+ credentials?: {
706
+ accessKeyId: string;
707
+ secretAccessKey: string;
708
+ };
709
+ }
710
+ /** Resolved storage configuration (internal) */
711
+ interface ResolvedStorageConfig {
712
+ bucket: string;
713
+ prefix: string;
714
+ region: string;
715
+ endpoint?: string;
716
+ credentials?: {
717
+ accessKeyId: string;
718
+ secretAccessKey: string;
719
+ };
720
+ mode: "byok" | "gateway";
721
+ gatewayUrl?: string;
722
+ gatewayApiKey?: string;
723
+ }
724
+ /**
725
+ * Checkpoint info returned after a successful run
726
+ *
727
+ * Pass `checkpoint.id` as `from` to restore into a fresh sandbox.
728
+ */
729
+ interface CheckpointInfo {
730
+ /** Checkpoint ID — pass as `from` to restore */
731
+ id: string;
732
+ /** SHA-256 of tar.gz — integrity verification */
733
+ hash: string;
734
+ /** Session tag at checkpoint time — lineage tracking */
735
+ tag: string;
736
+ /** ISO 8601 timestamp */
737
+ timestamp: string;
738
+ /** Archive size in bytes */
739
+ sizeBytes?: number;
740
+ /** Agent type that produced this checkpoint */
741
+ agentType?: string;
742
+ /** Model that produced this checkpoint */
743
+ model?: string;
744
+ /** Workspace mode used when checkpoint was created */
745
+ workspaceMode?: string;
746
+ /** Parent checkpoint ID — the checkpoint this was restored from (lineage tracking) */
747
+ parentId?: string;
748
+ /** User-provided label for this checkpoint */
749
+ comment?: string;
750
+ }
669
751
 
670
752
  /**
671
753
  * Composio Auth Helpers
@@ -774,6 +856,8 @@ declare class Agent {
774
856
  private sandboxState;
775
857
  private agentState;
776
858
  private readonly skills?;
859
+ private readonly storage?;
860
+ private lastCheckpointId?;
777
861
  private readonly zodSchema?;
778
862
  private readonly jsonSchema?;
779
863
  private readonly schemaOptions?;
@@ -802,6 +886,9 @@ declare class Agent {
802
886
  private setupAgentAuth;
803
887
  /**
804
888
  * Setup workspace structure and files
889
+ *
890
+ * @param opts.skipSystemPrompt - When true, skip writing the system prompt file.
891
+ * Used on restore from checkpoint: the tar already contains the correct file.
805
892
  */
806
893
  private setupWorkspace;
807
894
  /**
@@ -850,6 +937,16 @@ declare class Agent {
850
937
  * @param recursive - Include files in subdirectories (default: false)
851
938
  */
852
939
  getOutputFiles<T = unknown>(recursive?: boolean): Promise<OutputResult<T>>;
940
+ /**
941
+ * Create an explicit checkpoint of the current sandbox state.
942
+ *
943
+ * Requires an active sandbox (call run() first).
944
+ *
945
+ * @param options.comment - Optional label for this checkpoint
946
+ */
947
+ checkpoint(options?: {
948
+ comment?: string;
949
+ }): Promise<CheckpointInfo>;
853
950
  /**
854
951
  * Get current session (sandbox ID)
855
952
  */
@@ -1075,6 +1172,8 @@ interface EvolveConfig {
1075
1172
  observability?: Record<string, unknown>;
1076
1173
  /** Composio user ID and config */
1077
1174
  composio?: ComposioSetup;
1175
+ /** Storage configuration for checkpointing */
1176
+ storage?: StorageConfig;
1078
1177
  }
1079
1178
  /**
1080
1179
  * Evolve orchestrator with builder pattern
@@ -1218,6 +1317,23 @@ declare class Evolve extends EventEmitter {
1218
1317
  * })
1219
1318
  */
1220
1319
  withComposio(userId: string, config?: ComposioConfig): this;
1320
+ /**
1321
+ * Configure storage for checkpoint persistence
1322
+ *
1323
+ * BYOK mode: provide URL to your S3-compatible bucket.
1324
+ * Gateway mode: omit config (uses Evolve-managed storage, requires EVOLVE_API_KEY).
1325
+ *
1326
+ * @example
1327
+ * // BYOK — user's own S3 bucket
1328
+ * kit.withStorage({ url: "s3://my-bucket/agent-snapshots/" })
1329
+ *
1330
+ * // BYOK — Cloudflare R2
1331
+ * kit.withStorage({ url: "s3://my-bucket/prefix/", endpoint: "https://acct.r2.cloudflarestorage.com" })
1332
+ *
1333
+ * // Gateway — Evolve-managed storage
1334
+ * kit.withStorage()
1335
+ */
1336
+ withStorage(config?: StorageConfig): this;
1221
1337
  /**
1222
1338
  * Static helpers for Composio auth management
1223
1339
  *
@@ -1255,11 +1371,15 @@ declare class Evolve extends EventEmitter {
1255
1371
  private emitLifecycleFromStatus;
1256
1372
  /**
1257
1373
  * Run agent with prompt
1374
+ *
1375
+ * @param from - Restore from checkpoint ID before running (requires .withStorage())
1258
1376
  */
1259
- run({ prompt, timeoutMs, background, }: {
1377
+ run({ prompt, timeoutMs, background, from, checkpointComment, }: {
1260
1378
  prompt: string;
1261
1379
  timeoutMs?: number;
1262
1380
  background?: boolean;
1381
+ from?: string;
1382
+ checkpointComment?: string;
1263
1383
  }): Promise<AgentResponse>;
1264
1384
  /**
1265
1385
  * Execute arbitrary command in sandbox
@@ -1286,6 +1406,28 @@ declare class Evolve extends EventEmitter {
1286
1406
  * @param recursive - Include files in subdirectories (default: false)
1287
1407
  */
1288
1408
  getOutputFiles<T = unknown>(recursive?: boolean): Promise<OutputResult<T>>;
1409
+ /**
1410
+ * Create an explicit checkpoint of the current sandbox state.
1411
+ *
1412
+ * Requires a prior run() call (needs an active sandbox to snapshot).
1413
+ *
1414
+ * @param options.comment - Optional label for this checkpoint
1415
+ */
1416
+ checkpoint(options?: {
1417
+ comment?: string;
1418
+ }): Promise<CheckpointInfo>;
1419
+ /**
1420
+ * List checkpoints (requires .withStorage()).
1421
+ *
1422
+ * Does not require an agent or sandbox — only storage configuration.
1423
+ *
1424
+ * @param options.limit - Maximum number of checkpoints to return
1425
+ * @param options.tag - Filter by session tag (gateway mode: server-side, BYOK: post-filter)
1426
+ */
1427
+ listCheckpoints(options?: {
1428
+ limit?: number;
1429
+ tag?: string;
1430
+ }): Promise<CheckpointInfo[]>;
1289
1431
  /**
1290
1432
  * Get current session (sandbox ID)
1291
1433
  */
@@ -2462,4 +2604,38 @@ declare function readLocalDir(localPath: string, recursive?: boolean): FileMap;
2462
2604
  */
2463
2605
  declare function saveLocalDir(localPath: string, files: FileMap): void;
2464
2606
 
2465
- export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, saveLocalDir, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
2607
+ /**
2608
+ * Storage & Checkpointing Module
2609
+ *
2610
+ * Provides durable persistence for agent workspaces beyond sandbox lifetime.
2611
+ * Supports BYOK (user's S3 bucket) and Gateway (Evolve-managed) modes.
2612
+ *
2613
+ * Evidence: storage-checkpointing plan v2.2
2614
+ */
2615
+
2616
+ /**
2617
+ * Resolve storage configuration from user input.
2618
+ *
2619
+ * BYOK mode: URL provided → parse into bucket/prefix, use S3 client directly
2620
+ * Gateway mode: no URL → use dashboard API endpoints
2621
+ */
2622
+ declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2623
+ /**
2624
+ * List checkpoints (standalone — no Evolve instance needed).
2625
+ *
2626
+ * BYOK mode: reads directly from S3.
2627
+ * Gateway mode: reads EVOLVE_API_KEY from env, calls dashboard API.
2628
+ *
2629
+ * @example
2630
+ * // BYOK
2631
+ * const all = await listCheckpoints({ url: "s3://my-bucket/project/" });
2632
+ *
2633
+ * // Gateway
2634
+ * const all = await listCheckpoints({});
2635
+ */
2636
+ declare function listCheckpoints(config: StorageConfig, options?: {
2637
+ limit?: number;
2638
+ tag?: string;
2639
+ }): Promise<CheckpointInfo[]>;
2640
+
2641
+ export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type CheckpointInfo, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type ResolvedStorageConfig, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageConfig, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, listCheckpoints, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };