@evolvingmachines/sdk 0.0.30 → 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
@@ -2865,4 +2865,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2865
2865
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2866
2866
  declare function storage(config?: StorageConfig): StorageClient;
2867
2867
 
2868
- 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
@@ -2865,4 +2865,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2865
2865
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2866
2866
  declare function storage(config?: StorageConfig): StorageClient;
2867
2867
 
2868
- 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 };