@evolvingmachines/sdk 0.0.30 → 0.0.33

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
@@ -384,8 +384,6 @@ interface SkillsConfig {
384
384
  sourceDir: string;
385
385
  /** Target directory where skills are copied for this CLI */
386
386
  targetDir: string;
387
- /** CLI flag to enable skills (e.g., "--experimental-skills") */
388
- enableFlag?: string;
389
387
  }
390
388
  /** Reasoning effort for models that support it (Codex only) */
391
389
  type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
@@ -605,7 +603,7 @@ interface RunCost {
605
603
  prompt: number;
606
604
  completion: number;
607
605
  };
608
- /** Model used (e.g., "claude-opus-4-6"). Last observed model if multiple models used in a run. */
606
+ /** Model used (e.g., "claude-opus-4-7"). Last observed model if multiple models used in a run. */
609
607
  model: string;
610
608
  /** Number of LLM API requests in this run */
611
609
  requests: number;
@@ -2865,4 +2863,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2865
2863
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2866
2864
  declare function storage(config?: StorageConfig): StorageClient;
2867
2865
 
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 };
2866
+ /** Options for listing sessions */
2867
+ interface ListSessionsOptions {
2868
+ /** Max items per page (default: 20, max: 200) */
2869
+ limit?: number;
2870
+ /** Cursor for pagination (from SessionPage.nextCursor) */
2871
+ cursor?: string;
2872
+ /** Filter by session state */
2873
+ state?: "live" | "ended" | "all";
2874
+ /** Filter by agent type (e.g., "claude", "codex") */
2875
+ agent?: string;
2876
+ /** Filter by tag prefix */
2877
+ tagPrefix?: string;
2878
+ /** Sort order (default: "newest") */
2879
+ sort?: "newest" | "oldest" | "cost";
2880
+ }
2881
+ /** Paginated list of sessions */
2882
+ interface SessionPage {
2883
+ items: SessionInfo[];
2884
+ nextCursor: string | null;
2885
+ hasMore: boolean;
2886
+ }
2887
+ /** Session metadata */
2888
+ interface SessionInfo {
2889
+ id: string;
2890
+ tag: string;
2891
+ agent: string;
2892
+ model: string | null;
2893
+ provider: string;
2894
+ sandboxId: string | null;
2895
+ /** Ergonomic state: "live" (still running) or "ended" */
2896
+ state: "live" | "ended";
2897
+ /** Granular runtime status from dashboard */
2898
+ runtimeStatus: "alive" | "dead" | "unknown";
2899
+ /** Cost in USD. null if not synced yet. Eventually consistent. */
2900
+ cost: number | null;
2901
+ createdAt: string;
2902
+ endedAt: string | null;
2903
+ stepCount: number;
2904
+ toolStats: Record<string, number> | null;
2905
+ }
2906
+ /** Raw parsed JSONL event — no imposed schema */
2907
+ type SessionEvent = Record<string, unknown>;
2908
+ /** Options for downloading a session trace */
2909
+ interface DownloadSessionOptions {
2910
+ /** Directory to save the JSONL file (default: cwd) */
2911
+ to?: string;
2912
+ }
2913
+ /** Options for fetching parsed events */
2914
+ interface GetEventsOptions {
2915
+ /** Return only events after this index (delta fetching) */
2916
+ since?: number;
2917
+ }
2918
+ /** Configuration for sessions() factory */
2919
+ interface SessionsConfig {
2920
+ /** API key (default: process.env.EVOLVE_API_KEY) */
2921
+ apiKey?: string;
2922
+ /** Dashboard URL override (default: DEFAULT_DASHBOARD_URL) */
2923
+ dashboardUrl?: string;
2924
+ }
2925
+ /** Sessions client for querying past sessions and downloading traces */
2926
+ interface SessionsClient {
2927
+ /** List sessions with optional filtering and pagination */
2928
+ list(options?: ListSessionsOptions): Promise<SessionPage>;
2929
+ /** Get a single session by ID */
2930
+ get(id: string): Promise<SessionInfo>;
2931
+ /** Get parsed JSONL events for a session */
2932
+ events(id: string, options?: GetEventsOptions): Promise<SessionEvent[]>;
2933
+ /** Download raw JSONL trace file. Returns the file path. */
2934
+ download(id: string, options?: DownloadSessionOptions): Promise<string>;
2935
+ }
2936
+
2937
+ /**
2938
+ * Create a SessionsClient for querying past sessions and downloading traces.
2939
+ *
2940
+ * Gateway-only — requires EVOLVE_API_KEY.
2941
+ *
2942
+ * @example
2943
+ * ```ts
2944
+ * import { sessions } from "@evolvingmachines/sdk";
2945
+ *
2946
+ * const s = sessions();
2947
+ * const page = await s.list({ limit: 20, state: "ended" });
2948
+ * const events = await s.events(page.items[0].id);
2949
+ * await s.download(page.items[0].id, { to: "./traces" });
2950
+ * ```
2951
+ */
2952
+ declare function sessions(config?: SessionsConfig): SessionsClient;
2953
+
2954
+ 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
@@ -384,8 +384,6 @@ interface SkillsConfig {
384
384
  sourceDir: string;
385
385
  /** Target directory where skills are copied for this CLI */
386
386
  targetDir: string;
387
- /** CLI flag to enable skills (e.g., "--experimental-skills") */
388
- enableFlag?: string;
389
387
  }
390
388
  /** Reasoning effort for models that support it (Codex only) */
391
389
  type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
@@ -605,7 +603,7 @@ interface RunCost {
605
603
  prompt: number;
606
604
  completion: number;
607
605
  };
608
- /** Model used (e.g., "claude-opus-4-6"). Last observed model if multiple models used in a run. */
606
+ /** Model used (e.g., "claude-opus-4-7"). Last observed model if multiple models used in a run. */
609
607
  model: string;
610
608
  /** Number of LLM API requests in this run */
611
609
  requests: number;
@@ -2865,4 +2863,92 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
2865
2863
  declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
2866
2864
  declare function storage(config?: StorageConfig): StorageClient;
2867
2865
 
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 };
2866
+ /** Options for listing sessions */
2867
+ interface ListSessionsOptions {
2868
+ /** Max items per page (default: 20, max: 200) */
2869
+ limit?: number;
2870
+ /** Cursor for pagination (from SessionPage.nextCursor) */
2871
+ cursor?: string;
2872
+ /** Filter by session state */
2873
+ state?: "live" | "ended" | "all";
2874
+ /** Filter by agent type (e.g., "claude", "codex") */
2875
+ agent?: string;
2876
+ /** Filter by tag prefix */
2877
+ tagPrefix?: string;
2878
+ /** Sort order (default: "newest") */
2879
+ sort?: "newest" | "oldest" | "cost";
2880
+ }
2881
+ /** Paginated list of sessions */
2882
+ interface SessionPage {
2883
+ items: SessionInfo[];
2884
+ nextCursor: string | null;
2885
+ hasMore: boolean;
2886
+ }
2887
+ /** Session metadata */
2888
+ interface SessionInfo {
2889
+ id: string;
2890
+ tag: string;
2891
+ agent: string;
2892
+ model: string | null;
2893
+ provider: string;
2894
+ sandboxId: string | null;
2895
+ /** Ergonomic state: "live" (still running) or "ended" */
2896
+ state: "live" | "ended";
2897
+ /** Granular runtime status from dashboard */
2898
+ runtimeStatus: "alive" | "dead" | "unknown";
2899
+ /** Cost in USD. null if not synced yet. Eventually consistent. */
2900
+ cost: number | null;
2901
+ createdAt: string;
2902
+ endedAt: string | null;
2903
+ stepCount: number;
2904
+ toolStats: Record<string, number> | null;
2905
+ }
2906
+ /** Raw parsed JSONL event — no imposed schema */
2907
+ type SessionEvent = Record<string, unknown>;
2908
+ /** Options for downloading a session trace */
2909
+ interface DownloadSessionOptions {
2910
+ /** Directory to save the JSONL file (default: cwd) */
2911
+ to?: string;
2912
+ }
2913
+ /** Options for fetching parsed events */
2914
+ interface GetEventsOptions {
2915
+ /** Return only events after this index (delta fetching) */
2916
+ since?: number;
2917
+ }
2918
+ /** Configuration for sessions() factory */
2919
+ interface SessionsConfig {
2920
+ /** API key (default: process.env.EVOLVE_API_KEY) */
2921
+ apiKey?: string;
2922
+ /** Dashboard URL override (default: DEFAULT_DASHBOARD_URL) */
2923
+ dashboardUrl?: string;
2924
+ }
2925
+ /** Sessions client for querying past sessions and downloading traces */
2926
+ interface SessionsClient {
2927
+ /** List sessions with optional filtering and pagination */
2928
+ list(options?: ListSessionsOptions): Promise<SessionPage>;
2929
+ /** Get a single session by ID */
2930
+ get(id: string): Promise<SessionInfo>;
2931
+ /** Get parsed JSONL events for a session */
2932
+ events(id: string, options?: GetEventsOptions): Promise<SessionEvent[]>;
2933
+ /** Download raw JSONL trace file. Returns the file path. */
2934
+ download(id: string, options?: DownloadSessionOptions): Promise<string>;
2935
+ }
2936
+
2937
+ /**
2938
+ * Create a SessionsClient for querying past sessions and downloading traces.
2939
+ *
2940
+ * Gateway-only — requires EVOLVE_API_KEY.
2941
+ *
2942
+ * @example
2943
+ * ```ts
2944
+ * import { sessions } from "@evolvingmachines/sdk";
2945
+ *
2946
+ * const s = sessions();
2947
+ * const page = await s.list({ limit: 20, state: "ended" });
2948
+ * const events = await s.events(page.items[0].id);
2949
+ * await s.download(page.items[0].id, { to: "./traces" });
2950
+ * ```
2951
+ */
2952
+ declare function sessions(config?: SessionsConfig): SessionsClient;
2953
+
2954
+ 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 };