@evolvingmachines/sdk 0.0.29 → 0.0.31

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
@@ -966,6 +966,18 @@ declare class Agent {
966
966
  * Build environment variables for sandbox
967
967
  */
968
968
  private buildEnvironmentVariables;
969
+ /**
970
+ * Build the inline gateway config JSON for agents using gatewayConfigEnv
971
+ * (e.g., OpenCode OPENCODE_CONFIG_CONTENT). Centralizes the provider config
972
+ * so buildEnvironmentVariables() and buildRunEnvs() don't duplicate it.
973
+ *
974
+ * Deep-merges with user-provided config from secrets (if any) so that
975
+ * non-litellm providers, plugins, and other settings are preserved.
976
+ * Only patches provider.litellm.models[selectedModel].headers.
977
+ *
978
+ * Source-verified: model.headers → provider.ts:1061 → llm.ts:221 → HTTP request.
979
+ */
980
+ private buildGatewayConfigJson;
969
981
  /**
970
982
  * Build per-run env overrides for spend tracking.
971
983
  * Merges session + run headers into the custom headers env var,
@@ -2566,6 +2578,8 @@ interface AgentRegistryEntry {
2566
2578
  gatewayConfigEnv?: string;
2567
2579
  /** Environment variable that CLI reads for custom outbound HTTP headers */
2568
2580
  customHeadersEnv?: string;
2581
+ /** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
2582
+ customHeadersFormat?: "newline" | "comma";
2569
2583
  /**
2570
2584
  * Per-env-var spend tracking for CLIs that support env_http_headers in config
2571
2585
  * (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
@@ -2578,6 +2592,33 @@ interface AgentRegistryEntry {
2578
2592
  /** Env var name for x-litellm-tags value */
2579
2593
  runTagEnv: string;
2580
2594
  };
2595
+ /**
2596
+ * Config-file-based spend tracking for CLIs that read custom headers from a
2597
+ * JSON settings file (e.g., Qwen settings.json → model.generationConfig.customHeaders).
2598
+ * The SDK writes headers to this file before each run.
2599
+ * Source-verified: Qwen reads customHeaders from settings.json, not env vars.
2600
+ */
2601
+ spendTrackingJsonConfig?: {
2602
+ /** JSON path to the customHeaders object (dot-separated) */
2603
+ headersPath: string;
2604
+ };
2605
+ /**
2606
+ * TOML provider-based spend tracking for CLIs that read custom_headers from a
2607
+ * provider entry in config.toml (e.g., Kimi).
2608
+ * The SDK writes a provider+model entry with custom_headers before each run.
2609
+ * Source-verified: Kimi reads custom_headers from providers[name].custom_headers
2610
+ * in ~/.kimi/config.toml (config.py:45, llm.py:101).
2611
+ */
2612
+ spendTrackingTomlProvider?: {
2613
+ /** Config file path (e.g., "~/.kimi/config.toml") */
2614
+ configPath: string;
2615
+ /** Provider name in config (e.g., "evolve-gateway") */
2616
+ providerName: string;
2617
+ /** Model entry name (e.g., "evolve-default") */
2618
+ modelName: string;
2619
+ /** Max context size for the model entry */
2620
+ maxContextSize: number;
2621
+ };
2581
2622
  /** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
2582
2623
  * Used for agents like OpenCode that spread state across XDG directories. */
2583
2624
  checkpointDirs?: string[];
@@ -2824,4 +2865,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2824
2865
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2825
2866
  declare function storage(config?: StorageConfig): StorageClient;
2826
2867
 
2827
- 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 DownloadCheckpointOptions, type DownloadFilesOptions, 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 RunCost, 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 SessionCost, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageClient, 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, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
2868
+ /** Options for listing sessions */
2869
+ interface ListSessionsOptions {
2870
+ /** Max items per page (default: 20, max: 200) */
2871
+ limit?: number;
2872
+ /** Cursor for pagination (from SessionPage.nextCursor) */
2873
+ cursor?: string;
2874
+ /** Filter by session state */
2875
+ state?: "live" | "ended" | "all";
2876
+ /** Filter by agent type (e.g., "claude", "codex") */
2877
+ agent?: string;
2878
+ /** Filter by tag prefix */
2879
+ tagPrefix?: string;
2880
+ /** Sort order (default: "newest") */
2881
+ sort?: "newest" | "oldest" | "cost";
2882
+ }
2883
+ /** Paginated list of sessions */
2884
+ interface SessionPage {
2885
+ items: SessionInfo[];
2886
+ nextCursor: string | null;
2887
+ hasMore: boolean;
2888
+ }
2889
+ /** Session metadata */
2890
+ interface SessionInfo {
2891
+ id: string;
2892
+ tag: string;
2893
+ agent: string;
2894
+ model: string | null;
2895
+ provider: string;
2896
+ sandboxId: string | null;
2897
+ /** Ergonomic state: "live" (still running) or "ended" */
2898
+ state: "live" | "ended";
2899
+ /** Granular runtime status from dashboard */
2900
+ runtimeStatus: "alive" | "dead" | "unknown";
2901
+ /** Cost in USD. null if not synced yet. Eventually consistent. */
2902
+ cost: number | null;
2903
+ createdAt: string;
2904
+ endedAt: string | null;
2905
+ stepCount: number;
2906
+ toolStats: Record<string, number> | null;
2907
+ }
2908
+ /** Raw parsed JSONL event — no imposed schema */
2909
+ type SessionEvent = Record<string, unknown>;
2910
+ /** Options for downloading a session trace */
2911
+ interface DownloadSessionOptions {
2912
+ /** Directory to save the JSONL file (default: cwd) */
2913
+ to?: string;
2914
+ }
2915
+ /** Options for fetching parsed events */
2916
+ interface GetEventsOptions {
2917
+ /** Return only events after this index (delta fetching) */
2918
+ since?: number;
2919
+ }
2920
+ /** Configuration for sessions() factory */
2921
+ interface SessionsConfig {
2922
+ /** API key (default: process.env.EVOLVE_API_KEY) */
2923
+ apiKey?: string;
2924
+ /** Dashboard URL override (default: DEFAULT_DASHBOARD_URL) */
2925
+ dashboardUrl?: string;
2926
+ }
2927
+ /** Sessions client for querying past sessions and downloading traces */
2928
+ interface SessionsClient {
2929
+ /** List sessions with optional filtering and pagination */
2930
+ list(options?: ListSessionsOptions): Promise<SessionPage>;
2931
+ /** Get a single session by ID */
2932
+ get(id: string): Promise<SessionInfo>;
2933
+ /** Get parsed JSONL events for a session */
2934
+ events(id: string, options?: GetEventsOptions): Promise<SessionEvent[]>;
2935
+ /** Download raw JSONL trace file. Returns the file path. */
2936
+ download(id: string, options?: DownloadSessionOptions): Promise<string>;
2937
+ }
2938
+
2939
+ /**
2940
+ * Create a SessionsClient for querying past sessions and downloading traces.
2941
+ *
2942
+ * Gateway-only — requires EVOLVE_API_KEY.
2943
+ *
2944
+ * @example
2945
+ * ```ts
2946
+ * import { sessions } from "@evolvingmachines/sdk";
2947
+ *
2948
+ * const s = sessions();
2949
+ * const page = await s.list({ limit: 20, state: "ended" });
2950
+ * const events = await s.events(page.items[0].id);
2951
+ * await s.download(page.items[0].id, { to: "./traces" });
2952
+ * ```
2953
+ */
2954
+ declare function sessions(config?: SessionsConfig): SessionsClient;
2955
+
2956
+ 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 DownloadCheckpointOptions, type DownloadFilesOptions, type DownloadSessionOptions, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type GetEventsOptions, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type ListSessionsOptions, 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 RunCost, 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 SessionCost, type SessionEvent, type SessionInfo, type SessionPage, type SessionStatus, type SessionsClient, type SessionsConfig, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageClient, 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, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, sessions, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
package/dist/index.d.ts CHANGED
@@ -966,6 +966,18 @@ declare class Agent {
966
966
  * Build environment variables for sandbox
967
967
  */
968
968
  private buildEnvironmentVariables;
969
+ /**
970
+ * Build the inline gateway config JSON for agents using gatewayConfigEnv
971
+ * (e.g., OpenCode OPENCODE_CONFIG_CONTENT). Centralizes the provider config
972
+ * so buildEnvironmentVariables() and buildRunEnvs() don't duplicate it.
973
+ *
974
+ * Deep-merges with user-provided config from secrets (if any) so that
975
+ * non-litellm providers, plugins, and other settings are preserved.
976
+ * Only patches provider.litellm.models[selectedModel].headers.
977
+ *
978
+ * Source-verified: model.headers → provider.ts:1061 → llm.ts:221 → HTTP request.
979
+ */
980
+ private buildGatewayConfigJson;
969
981
  /**
970
982
  * Build per-run env overrides for spend tracking.
971
983
  * Merges session + run headers into the custom headers env var,
@@ -2566,6 +2578,8 @@ interface AgentRegistryEntry {
2566
2578
  gatewayConfigEnv?: string;
2567
2579
  /** Environment variable that CLI reads for custom outbound HTTP headers */
2568
2580
  customHeadersEnv?: string;
2581
+ /** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
2582
+ customHeadersFormat?: "newline" | "comma";
2569
2583
  /**
2570
2584
  * Per-env-var spend tracking for CLIs that support env_http_headers in config
2571
2585
  * (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
@@ -2578,6 +2592,33 @@ interface AgentRegistryEntry {
2578
2592
  /** Env var name for x-litellm-tags value */
2579
2593
  runTagEnv: string;
2580
2594
  };
2595
+ /**
2596
+ * Config-file-based spend tracking for CLIs that read custom headers from a
2597
+ * JSON settings file (e.g., Qwen settings.json → model.generationConfig.customHeaders).
2598
+ * The SDK writes headers to this file before each run.
2599
+ * Source-verified: Qwen reads customHeaders from settings.json, not env vars.
2600
+ */
2601
+ spendTrackingJsonConfig?: {
2602
+ /** JSON path to the customHeaders object (dot-separated) */
2603
+ headersPath: string;
2604
+ };
2605
+ /**
2606
+ * TOML provider-based spend tracking for CLIs that read custom_headers from a
2607
+ * provider entry in config.toml (e.g., Kimi).
2608
+ * The SDK writes a provider+model entry with custom_headers before each run.
2609
+ * Source-verified: Kimi reads custom_headers from providers[name].custom_headers
2610
+ * in ~/.kimi/config.toml (config.py:45, llm.py:101).
2611
+ */
2612
+ spendTrackingTomlProvider?: {
2613
+ /** Config file path (e.g., "~/.kimi/config.toml") */
2614
+ configPath: string;
2615
+ /** Provider name in config (e.g., "evolve-gateway") */
2616
+ providerName: string;
2617
+ /** Model entry name (e.g., "evolve-default") */
2618
+ modelName: string;
2619
+ /** Max context size for the model entry */
2620
+ maxContextSize: number;
2621
+ };
2581
2622
  /** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
2582
2623
  * Used for agents like OpenCode that spread state across XDG directories. */
2583
2624
  checkpointDirs?: string[];
@@ -2824,4 +2865,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2824
2865
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2825
2866
  declare function storage(config?: StorageConfig): StorageClient;
2826
2867
 
2827
- 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 DownloadCheckpointOptions, type DownloadFilesOptions, 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 RunCost, 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 SessionCost, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageClient, 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, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
2868
+ /** Options for listing sessions */
2869
+ interface ListSessionsOptions {
2870
+ /** Max items per page (default: 20, max: 200) */
2871
+ limit?: number;
2872
+ /** Cursor for pagination (from SessionPage.nextCursor) */
2873
+ cursor?: string;
2874
+ /** Filter by session state */
2875
+ state?: "live" | "ended" | "all";
2876
+ /** Filter by agent type (e.g., "claude", "codex") */
2877
+ agent?: string;
2878
+ /** Filter by tag prefix */
2879
+ tagPrefix?: string;
2880
+ /** Sort order (default: "newest") */
2881
+ sort?: "newest" | "oldest" | "cost";
2882
+ }
2883
+ /** Paginated list of sessions */
2884
+ interface SessionPage {
2885
+ items: SessionInfo[];
2886
+ nextCursor: string | null;
2887
+ hasMore: boolean;
2888
+ }
2889
+ /** Session metadata */
2890
+ interface SessionInfo {
2891
+ id: string;
2892
+ tag: string;
2893
+ agent: string;
2894
+ model: string | null;
2895
+ provider: string;
2896
+ sandboxId: string | null;
2897
+ /** Ergonomic state: "live" (still running) or "ended" */
2898
+ state: "live" | "ended";
2899
+ /** Granular runtime status from dashboard */
2900
+ runtimeStatus: "alive" | "dead" | "unknown";
2901
+ /** Cost in USD. null if not synced yet. Eventually consistent. */
2902
+ cost: number | null;
2903
+ createdAt: string;
2904
+ endedAt: string | null;
2905
+ stepCount: number;
2906
+ toolStats: Record<string, number> | null;
2907
+ }
2908
+ /** Raw parsed JSONL event — no imposed schema */
2909
+ type SessionEvent = Record<string, unknown>;
2910
+ /** Options for downloading a session trace */
2911
+ interface DownloadSessionOptions {
2912
+ /** Directory to save the JSONL file (default: cwd) */
2913
+ to?: string;
2914
+ }
2915
+ /** Options for fetching parsed events */
2916
+ interface GetEventsOptions {
2917
+ /** Return only events after this index (delta fetching) */
2918
+ since?: number;
2919
+ }
2920
+ /** Configuration for sessions() factory */
2921
+ interface SessionsConfig {
2922
+ /** API key (default: process.env.EVOLVE_API_KEY) */
2923
+ apiKey?: string;
2924
+ /** Dashboard URL override (default: DEFAULT_DASHBOARD_URL) */
2925
+ dashboardUrl?: string;
2926
+ }
2927
+ /** Sessions client for querying past sessions and downloading traces */
2928
+ interface SessionsClient {
2929
+ /** List sessions with optional filtering and pagination */
2930
+ list(options?: ListSessionsOptions): Promise<SessionPage>;
2931
+ /** Get a single session by ID */
2932
+ get(id: string): Promise<SessionInfo>;
2933
+ /** Get parsed JSONL events for a session */
2934
+ events(id: string, options?: GetEventsOptions): Promise<SessionEvent[]>;
2935
+ /** Download raw JSONL trace file. Returns the file path. */
2936
+ download(id: string, options?: DownloadSessionOptions): Promise<string>;
2937
+ }
2938
+
2939
+ /**
2940
+ * Create a SessionsClient for querying past sessions and downloading traces.
2941
+ *
2942
+ * Gateway-only — requires EVOLVE_API_KEY.
2943
+ *
2944
+ * @example
2945
+ * ```ts
2946
+ * import { sessions } from "@evolvingmachines/sdk";
2947
+ *
2948
+ * const s = sessions();
2949
+ * const page = await s.list({ limit: 20, state: "ended" });
2950
+ * const events = await s.events(page.items[0].id);
2951
+ * await s.download(page.items[0].id, { to: "./traces" });
2952
+ * ```
2953
+ */
2954
+ declare function sessions(config?: SessionsConfig): SessionsClient;
2955
+
2956
+ 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 DownloadCheckpointOptions, type DownloadFilesOptions, type DownloadSessionOptions, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type GetEventsOptions, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type ListSessionsOptions, 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 RunCost, 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 SessionCost, type SessionEvent, type SessionInfo, type SessionPage, type SessionStatus, type SessionsClient, type SessionsConfig, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageClient, 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, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, sessions, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };