@evolvingmachines/sdk 0.0.33 → 0.0.34
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/LICENSE +201 -113
- package/dist/index.cjs +64 -63
- package/dist/index.d.cts +126 -8
- package/dist/index.d.ts +126 -8
- package/dist/index.js +64 -63
- package/package.json +5 -3
package/dist/index.d.cts
CHANGED
|
@@ -364,7 +364,7 @@ interface SandboxProvider {
|
|
|
364
364
|
connect(sandboxId: string, timeoutMs?: number): Promise<SandboxInstance>;
|
|
365
365
|
}
|
|
366
366
|
/** Supported agent types (headless CLI agents only, no ACP) */
|
|
367
|
-
type AgentType = "claude" | "codex" | "gemini" | "qwen" | "kimi" | "opencode";
|
|
367
|
+
type AgentType = "claude" | "codex" | "gemini" | "qwen" | "kimi" | "opencode" | "droid";
|
|
368
368
|
/** Agent type constants for use in code */
|
|
369
369
|
declare const AGENT_TYPES: {
|
|
370
370
|
readonly CLAUDE: "claude";
|
|
@@ -373,11 +373,45 @@ declare const AGENT_TYPES: {
|
|
|
373
373
|
readonly QWEN: "qwen";
|
|
374
374
|
readonly KIMI: "kimi";
|
|
375
375
|
readonly OPENCODE: "opencode";
|
|
376
|
+
readonly DROID: "droid";
|
|
376
377
|
};
|
|
377
378
|
/** Workspace mode determines folder structure and system prompt */
|
|
378
379
|
type WorkspaceMode = "knowledge" | "swe";
|
|
379
380
|
/** Available skills that can be enabled */
|
|
380
381
|
type SkillName = "pdf" | "dev-browser" | (string & {});
|
|
382
|
+
/** Browser automation providers that can be enabled explicitly */
|
|
383
|
+
type BrowserProvider = "browser-use";
|
|
384
|
+
/** Marketplace plugin shape for CLIs with explicit plugin install commands. */
|
|
385
|
+
interface MarketplaceAgentPluginConfig {
|
|
386
|
+
/** Marketplace URL/source to register in the sandbox user profile */
|
|
387
|
+
marketplace: string;
|
|
388
|
+
/** Plugin identifier, usually plugin@marketplace */
|
|
389
|
+
plugin: string;
|
|
390
|
+
}
|
|
391
|
+
/** Gemini extension install shape. */
|
|
392
|
+
interface GeminiAgentPluginConfig {
|
|
393
|
+
/** GitHub URL or local path for the extension */
|
|
394
|
+
source: string;
|
|
395
|
+
/** Optional git ref to install */
|
|
396
|
+
ref?: string;
|
|
397
|
+
/** Enable extension auto-update */
|
|
398
|
+
autoUpdate?: boolean;
|
|
399
|
+
/** Enable pre-release versions */
|
|
400
|
+
preRelease?: boolean;
|
|
401
|
+
/** Skip extension settings prompts during install */
|
|
402
|
+
skipSettings?: boolean;
|
|
403
|
+
}
|
|
404
|
+
/** Codex marketplace registration shape. */
|
|
405
|
+
interface CodexAgentPluginConfig {
|
|
406
|
+
/** Marketplace source to register */
|
|
407
|
+
marketplace: string;
|
|
408
|
+
/** Optional git ref to pin */
|
|
409
|
+
ref?: string;
|
|
410
|
+
/** Optional sparse checkout paths for Git-backed marketplaces */
|
|
411
|
+
sparse?: string[];
|
|
412
|
+
}
|
|
413
|
+
/** Agent plugin/extension config. Shape is validated against the selected agent at runtime. */
|
|
414
|
+
type AgentPluginConfig = MarketplaceAgentPluginConfig | GeminiAgentPluginConfig | CodexAgentPluginConfig;
|
|
381
415
|
/** Skills configuration for an agent */
|
|
382
416
|
interface SkillsConfig {
|
|
383
417
|
/** Source directory where skills are staged */
|
|
@@ -385,8 +419,8 @@ interface SkillsConfig {
|
|
|
385
419
|
/** Target directory where skills are copied for this CLI */
|
|
386
420
|
targetDir: string;
|
|
387
421
|
}
|
|
388
|
-
/** Reasoning effort for models that support it
|
|
389
|
-
type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
422
|
+
/** Reasoning effort for CLIs/models that support it; valid values vary by model. */
|
|
423
|
+
type ReasoningEffort = "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
390
424
|
/** MCP Server Configuration */
|
|
391
425
|
interface McpServerConfig {
|
|
392
426
|
command?: string;
|
|
@@ -460,7 +494,7 @@ interface AgentConfig {
|
|
|
460
494
|
providerBaseUrl?: string;
|
|
461
495
|
/** Model to use (optional, uses agent's default if omitted) */
|
|
462
496
|
model?: string;
|
|
463
|
-
/** Reasoning effort for
|
|
497
|
+
/** Reasoning effort for models that support it */
|
|
464
498
|
reasoningEffort?: ReasoningEffort;
|
|
465
499
|
}
|
|
466
500
|
/** Resolved agent config (output of resolution, not an extension of input) */
|
|
@@ -495,6 +529,8 @@ interface AgentOptions {
|
|
|
495
529
|
files?: FileMap;
|
|
496
530
|
/** MCP server configurations */
|
|
497
531
|
mcpServers?: Record<string, McpServerConfig>;
|
|
532
|
+
/** Plugins/extensions to install in the sandbox user profile before first run */
|
|
533
|
+
plugins?: AgentPluginConfig[];
|
|
498
534
|
/** Skills to enable (e.g., ["pdf", "dev-browser"]) */
|
|
499
535
|
skills?: SkillName[];
|
|
500
536
|
/**
|
|
@@ -939,6 +975,7 @@ declare class Agent {
|
|
|
939
975
|
private interruptedOperations;
|
|
940
976
|
private sandboxState;
|
|
941
977
|
private agentState;
|
|
978
|
+
private droidSessionId?;
|
|
942
979
|
private readonly skills?;
|
|
943
980
|
private readonly storage?;
|
|
944
981
|
private lastCheckpointId?;
|
|
@@ -983,10 +1020,18 @@ declare class Agent {
|
|
|
983
1020
|
* Passed to spawn() so each .run() gets a unique run tag.
|
|
984
1021
|
*/
|
|
985
1022
|
private buildRunEnvs;
|
|
1023
|
+
private captureDroidSession;
|
|
1024
|
+
private extractDroidSessionId;
|
|
1025
|
+
private findDroidSessionId;
|
|
1026
|
+
private loadDroidSessionState;
|
|
1027
|
+
private writeDroidSessionState;
|
|
1028
|
+
private resolveGatewayModel;
|
|
1029
|
+
private resolveCommandModel;
|
|
986
1030
|
/**
|
|
987
1031
|
* Agent-specific authentication setup
|
|
988
1032
|
*/
|
|
989
1033
|
private setupAgentAuth;
|
|
1034
|
+
private setupAgentPlugins;
|
|
990
1035
|
/**
|
|
991
1036
|
* Setup workspace structure and files
|
|
992
1037
|
*
|
|
@@ -1206,6 +1251,15 @@ declare function createClaudeParser(): (jsonLine: string) => OutputEvent[] | nul
|
|
|
1206
1251
|
*/
|
|
1207
1252
|
declare function createCodexParser(): (jsonLine: string) => OutputEvent[] | null;
|
|
1208
1253
|
|
|
1254
|
+
/**
|
|
1255
|
+
* Droid exec parser.
|
|
1256
|
+
*
|
|
1257
|
+
* Supports the documented headless `--output-format stream-json` lines and the
|
|
1258
|
+
* raw `stream-jsonrpc` notification envelope used by Droid's low-level SDK.
|
|
1259
|
+
*/
|
|
1260
|
+
|
|
1261
|
+
declare function createDroidParser(): (jsonLine: string) => OutputEvent[] | null;
|
|
1262
|
+
|
|
1209
1263
|
/**
|
|
1210
1264
|
* Gemini JSONL → ACP-style events parser.
|
|
1211
1265
|
*
|
|
@@ -1320,6 +1374,10 @@ interface EvolveConfig {
|
|
|
1320
1374
|
context?: FileMap;
|
|
1321
1375
|
files?: FileMap;
|
|
1322
1376
|
mcpServers?: Record<string, McpServerConfig>;
|
|
1377
|
+
/** Browser automation provider to enable explicitly */
|
|
1378
|
+
browser?: BrowserProvider;
|
|
1379
|
+
/** Agent plugins/extensions to install before first run */
|
|
1380
|
+
plugins?: AgentPluginConfig[];
|
|
1323
1381
|
/** Skills to enable (e.g., ["pdf", "dev-browser"]) */
|
|
1324
1382
|
skills?: SkillName[];
|
|
1325
1383
|
/** Schema for structured output (Zod or JSON Schema, auto-detected) */
|
|
@@ -1401,6 +1459,28 @@ declare class Evolve extends EventEmitter {
|
|
|
1401
1459
|
* Configure MCP servers
|
|
1402
1460
|
*/
|
|
1403
1461
|
withMcpServers(servers: Record<string, McpServerConfig>): this;
|
|
1462
|
+
/**
|
|
1463
|
+
* Enable browser automation.
|
|
1464
|
+
*
|
|
1465
|
+
* Gateway mode supports "browser-use", exposed as the same MCP server that
|
|
1466
|
+
* was previously included automatically.
|
|
1467
|
+
*
|
|
1468
|
+
* @example
|
|
1469
|
+
* kit.withBrowser("browser-use") // explicit provider
|
|
1470
|
+
*
|
|
1471
|
+
* @example
|
|
1472
|
+
* kit.withBrowser() // defaults to "browser-use"
|
|
1473
|
+
*/
|
|
1474
|
+
withBrowser(provider?: BrowserProvider | false): this;
|
|
1475
|
+
/**
|
|
1476
|
+
* Install agent plugins/extensions in the sandbox user profile.
|
|
1477
|
+
*
|
|
1478
|
+
* The selected agent determines the installer:
|
|
1479
|
+
* - droid/claude: { marketplace, plugin }
|
|
1480
|
+
* - gemini: { source, ref? }
|
|
1481
|
+
* - codex: { marketplace, ref?, sparse? }
|
|
1482
|
+
*/
|
|
1483
|
+
withPlugins(plugins: AgentPluginConfig | AgentPluginConfig[]): this;
|
|
1404
1484
|
/**
|
|
1405
1485
|
* Enable skills for the agent
|
|
1406
1486
|
*
|
|
@@ -2527,6 +2607,7 @@ interface BuildCommandOptions {
|
|
|
2527
2607
|
prompt: string;
|
|
2528
2608
|
model: string;
|
|
2529
2609
|
isResume: boolean;
|
|
2610
|
+
sessionId?: string;
|
|
2530
2611
|
reasoningEffort?: string;
|
|
2531
2612
|
isDirectMode?: boolean;
|
|
2532
2613
|
/** Skills enabled for this run */
|
|
@@ -2546,8 +2627,8 @@ interface AgentRegistryEntry {
|
|
|
2546
2627
|
key: string;
|
|
2547
2628
|
value: string;
|
|
2548
2629
|
};
|
|
2549
|
-
/** Environment variable name for base URL */
|
|
2550
|
-
baseUrlEnv
|
|
2630
|
+
/** Environment variable name for base URL, if this CLI supports one */
|
|
2631
|
+
baseUrlEnv?: string;
|
|
2551
2632
|
/** Default model alias */
|
|
2552
2633
|
defaultModel: string;
|
|
2553
2634
|
/** Available models for this agent */
|
|
@@ -2574,6 +2655,19 @@ interface AgentRegistryEntry {
|
|
|
2574
2655
|
}>;
|
|
2575
2656
|
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
2576
2657
|
gatewayConfigEnv?: string;
|
|
2658
|
+
/** Gateway-only model aliases for CLIs whose native model IDs differ from LiteLLM route names */
|
|
2659
|
+
gatewayModelAliases?: Record<string, string>;
|
|
2660
|
+
/** Direct-mode model aliases for CLIs whose public model names differ from CLI-native model IDs */
|
|
2661
|
+
directModelAliases?: Record<string, string>;
|
|
2662
|
+
/** Do not set provider API key env in gateway mode (used when routing via generated settings instead) */
|
|
2663
|
+
skipApiKeyEnvInGateway?: boolean;
|
|
2664
|
+
/** Dedicated Droid settings file for Evolve gateway custom model routing */
|
|
2665
|
+
droidGatewaySettings?: {
|
|
2666
|
+
settingsPath: string;
|
|
2667
|
+
displayName: string;
|
|
2668
|
+
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
2669
|
+
maxOutputTokens?: number;
|
|
2670
|
+
};
|
|
2577
2671
|
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2578
2672
|
customHeadersEnv?: string;
|
|
2579
2673
|
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
@@ -2652,7 +2746,7 @@ declare function getMcpSettingsDir(agentType: AgentType): string;
|
|
|
2652
2746
|
/**
|
|
2653
2747
|
* MCP JSON Configuration Writer
|
|
2654
2748
|
*
|
|
2655
|
-
* Handles MCP config for Claude, Gemini, Qwen, and
|
|
2749
|
+
* Handles MCP config for Claude, Gemini, Qwen, Kimi, Droid, and OpenCode agents.
|
|
2656
2750
|
* Uses registry for paths - no hardcoded values.
|
|
2657
2751
|
*
|
|
2658
2752
|
* Transport formats by agent:
|
|
@@ -2674,6 +2768,29 @@ declare function writeClaudeMcpConfig(sandbox: SandboxInstance, workingDir: stri
|
|
|
2674
2768
|
declare function writeGeminiMcpConfig(sandbox: SandboxInstance, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2675
2769
|
/** Write MCP config for Qwen agent */
|
|
2676
2770
|
declare function writeQwenMcpConfig(sandbox: SandboxInstance, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2771
|
+
/**
|
|
2772
|
+
* Write MCP config for Droid agent
|
|
2773
|
+
*
|
|
2774
|
+
* Droid supports project-level `.factory/mcp.json`, which keeps MCP config
|
|
2775
|
+
* scoped to the sandbox workspace instead of mutating global user config.
|
|
2776
|
+
*/
|
|
2777
|
+
declare function writeDroidMcpConfig(sandbox: SandboxInstance, workingDir: string, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2778
|
+
interface DroidGatewaySettingsConfig {
|
|
2779
|
+
settingsPath: string;
|
|
2780
|
+
displayName: string;
|
|
2781
|
+
model: string;
|
|
2782
|
+
baseUrl: string;
|
|
2783
|
+
apiKeyEnv: string;
|
|
2784
|
+
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
2785
|
+
maxOutputTokens?: number;
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Write an Evolve-owned Droid settings file for gateway custom-model routing.
|
|
2789
|
+
*
|
|
2790
|
+
* The command passes this file with `droid --settings`, so it does not alter the
|
|
2791
|
+
* user's normal ~/.factory/settings.json inside the sandbox.
|
|
2792
|
+
*/
|
|
2793
|
+
declare function writeDroidGatewaySettings(sandbox: SandboxInstance, config: DroidGatewaySettingsConfig, headers: Record<string, string>): Promise<void>;
|
|
2677
2794
|
|
|
2678
2795
|
/**
|
|
2679
2796
|
* MCP TOML Configuration Writer
|
|
@@ -2705,6 +2822,7 @@ declare function writeCodexMcpConfig(sandbox: SandboxInstance, servers: Record<s
|
|
|
2705
2822
|
* - Codex: TOML to ~/.codex/config.toml
|
|
2706
2823
|
* - Gemini: JSON to ~/.gemini/settings.json
|
|
2707
2824
|
* - Qwen: JSON to ~/.qwen/settings.json
|
|
2825
|
+
* - Droid: JSON to ${workingDir}/.factory/mcp.json
|
|
2708
2826
|
* - OpenCode: JSON to ${workingDir}/opencode.json (mcp key)
|
|
2709
2827
|
*/
|
|
2710
2828
|
declare function writeMcpConfig(agentType: AgentType, sandbox: SandboxInstance, workingDir: string, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
@@ -2951,4 +3069,4 @@ interface SessionsClient {
|
|
|
2951
3069
|
*/
|
|
2952
3070
|
declare function sessions(config?: SessionsConfig): SessionsClient;
|
|
2953
3071
|
|
|
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 };
|
|
3072
|
+
export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentPluginConfig, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type BrowserProvider, type CandidateCompleteEvent, type CheckpointInfo, type CodexAgentPluginConfig, 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 GeminiAgentPluginConfig, 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 MarketplaceAgentPluginConfig, 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, createDroidParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, sessions, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeDroidGatewaySettings, writeDroidMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
|
package/dist/index.d.ts
CHANGED
|
@@ -364,7 +364,7 @@ interface SandboxProvider {
|
|
|
364
364
|
connect(sandboxId: string, timeoutMs?: number): Promise<SandboxInstance>;
|
|
365
365
|
}
|
|
366
366
|
/** Supported agent types (headless CLI agents only, no ACP) */
|
|
367
|
-
type AgentType = "claude" | "codex" | "gemini" | "qwen" | "kimi" | "opencode";
|
|
367
|
+
type AgentType = "claude" | "codex" | "gemini" | "qwen" | "kimi" | "opencode" | "droid";
|
|
368
368
|
/** Agent type constants for use in code */
|
|
369
369
|
declare const AGENT_TYPES: {
|
|
370
370
|
readonly CLAUDE: "claude";
|
|
@@ -373,11 +373,45 @@ declare const AGENT_TYPES: {
|
|
|
373
373
|
readonly QWEN: "qwen";
|
|
374
374
|
readonly KIMI: "kimi";
|
|
375
375
|
readonly OPENCODE: "opencode";
|
|
376
|
+
readonly DROID: "droid";
|
|
376
377
|
};
|
|
377
378
|
/** Workspace mode determines folder structure and system prompt */
|
|
378
379
|
type WorkspaceMode = "knowledge" | "swe";
|
|
379
380
|
/** Available skills that can be enabled */
|
|
380
381
|
type SkillName = "pdf" | "dev-browser" | (string & {});
|
|
382
|
+
/** Browser automation providers that can be enabled explicitly */
|
|
383
|
+
type BrowserProvider = "browser-use";
|
|
384
|
+
/** Marketplace plugin shape for CLIs with explicit plugin install commands. */
|
|
385
|
+
interface MarketplaceAgentPluginConfig {
|
|
386
|
+
/** Marketplace URL/source to register in the sandbox user profile */
|
|
387
|
+
marketplace: string;
|
|
388
|
+
/** Plugin identifier, usually plugin@marketplace */
|
|
389
|
+
plugin: string;
|
|
390
|
+
}
|
|
391
|
+
/** Gemini extension install shape. */
|
|
392
|
+
interface GeminiAgentPluginConfig {
|
|
393
|
+
/** GitHub URL or local path for the extension */
|
|
394
|
+
source: string;
|
|
395
|
+
/** Optional git ref to install */
|
|
396
|
+
ref?: string;
|
|
397
|
+
/** Enable extension auto-update */
|
|
398
|
+
autoUpdate?: boolean;
|
|
399
|
+
/** Enable pre-release versions */
|
|
400
|
+
preRelease?: boolean;
|
|
401
|
+
/** Skip extension settings prompts during install */
|
|
402
|
+
skipSettings?: boolean;
|
|
403
|
+
}
|
|
404
|
+
/** Codex marketplace registration shape. */
|
|
405
|
+
interface CodexAgentPluginConfig {
|
|
406
|
+
/** Marketplace source to register */
|
|
407
|
+
marketplace: string;
|
|
408
|
+
/** Optional git ref to pin */
|
|
409
|
+
ref?: string;
|
|
410
|
+
/** Optional sparse checkout paths for Git-backed marketplaces */
|
|
411
|
+
sparse?: string[];
|
|
412
|
+
}
|
|
413
|
+
/** Agent plugin/extension config. Shape is validated against the selected agent at runtime. */
|
|
414
|
+
type AgentPluginConfig = MarketplaceAgentPluginConfig | GeminiAgentPluginConfig | CodexAgentPluginConfig;
|
|
381
415
|
/** Skills configuration for an agent */
|
|
382
416
|
interface SkillsConfig {
|
|
383
417
|
/** Source directory where skills are staged */
|
|
@@ -385,8 +419,8 @@ interface SkillsConfig {
|
|
|
385
419
|
/** Target directory where skills are copied for this CLI */
|
|
386
420
|
targetDir: string;
|
|
387
421
|
}
|
|
388
|
-
/** Reasoning effort for models that support it
|
|
389
|
-
type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
422
|
+
/** Reasoning effort for CLIs/models that support it; valid values vary by model. */
|
|
423
|
+
type ReasoningEffort = "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
390
424
|
/** MCP Server Configuration */
|
|
391
425
|
interface McpServerConfig {
|
|
392
426
|
command?: string;
|
|
@@ -460,7 +494,7 @@ interface AgentConfig {
|
|
|
460
494
|
providerBaseUrl?: string;
|
|
461
495
|
/** Model to use (optional, uses agent's default if omitted) */
|
|
462
496
|
model?: string;
|
|
463
|
-
/** Reasoning effort for
|
|
497
|
+
/** Reasoning effort for models that support it */
|
|
464
498
|
reasoningEffort?: ReasoningEffort;
|
|
465
499
|
}
|
|
466
500
|
/** Resolved agent config (output of resolution, not an extension of input) */
|
|
@@ -495,6 +529,8 @@ interface AgentOptions {
|
|
|
495
529
|
files?: FileMap;
|
|
496
530
|
/** MCP server configurations */
|
|
497
531
|
mcpServers?: Record<string, McpServerConfig>;
|
|
532
|
+
/** Plugins/extensions to install in the sandbox user profile before first run */
|
|
533
|
+
plugins?: AgentPluginConfig[];
|
|
498
534
|
/** Skills to enable (e.g., ["pdf", "dev-browser"]) */
|
|
499
535
|
skills?: SkillName[];
|
|
500
536
|
/**
|
|
@@ -939,6 +975,7 @@ declare class Agent {
|
|
|
939
975
|
private interruptedOperations;
|
|
940
976
|
private sandboxState;
|
|
941
977
|
private agentState;
|
|
978
|
+
private droidSessionId?;
|
|
942
979
|
private readonly skills?;
|
|
943
980
|
private readonly storage?;
|
|
944
981
|
private lastCheckpointId?;
|
|
@@ -983,10 +1020,18 @@ declare class Agent {
|
|
|
983
1020
|
* Passed to spawn() so each .run() gets a unique run tag.
|
|
984
1021
|
*/
|
|
985
1022
|
private buildRunEnvs;
|
|
1023
|
+
private captureDroidSession;
|
|
1024
|
+
private extractDroidSessionId;
|
|
1025
|
+
private findDroidSessionId;
|
|
1026
|
+
private loadDroidSessionState;
|
|
1027
|
+
private writeDroidSessionState;
|
|
1028
|
+
private resolveGatewayModel;
|
|
1029
|
+
private resolveCommandModel;
|
|
986
1030
|
/**
|
|
987
1031
|
* Agent-specific authentication setup
|
|
988
1032
|
*/
|
|
989
1033
|
private setupAgentAuth;
|
|
1034
|
+
private setupAgentPlugins;
|
|
990
1035
|
/**
|
|
991
1036
|
* Setup workspace structure and files
|
|
992
1037
|
*
|
|
@@ -1206,6 +1251,15 @@ declare function createClaudeParser(): (jsonLine: string) => OutputEvent[] | nul
|
|
|
1206
1251
|
*/
|
|
1207
1252
|
declare function createCodexParser(): (jsonLine: string) => OutputEvent[] | null;
|
|
1208
1253
|
|
|
1254
|
+
/**
|
|
1255
|
+
* Droid exec parser.
|
|
1256
|
+
*
|
|
1257
|
+
* Supports the documented headless `--output-format stream-json` lines and the
|
|
1258
|
+
* raw `stream-jsonrpc` notification envelope used by Droid's low-level SDK.
|
|
1259
|
+
*/
|
|
1260
|
+
|
|
1261
|
+
declare function createDroidParser(): (jsonLine: string) => OutputEvent[] | null;
|
|
1262
|
+
|
|
1209
1263
|
/**
|
|
1210
1264
|
* Gemini JSONL → ACP-style events parser.
|
|
1211
1265
|
*
|
|
@@ -1320,6 +1374,10 @@ interface EvolveConfig {
|
|
|
1320
1374
|
context?: FileMap;
|
|
1321
1375
|
files?: FileMap;
|
|
1322
1376
|
mcpServers?: Record<string, McpServerConfig>;
|
|
1377
|
+
/** Browser automation provider to enable explicitly */
|
|
1378
|
+
browser?: BrowserProvider;
|
|
1379
|
+
/** Agent plugins/extensions to install before first run */
|
|
1380
|
+
plugins?: AgentPluginConfig[];
|
|
1323
1381
|
/** Skills to enable (e.g., ["pdf", "dev-browser"]) */
|
|
1324
1382
|
skills?: SkillName[];
|
|
1325
1383
|
/** Schema for structured output (Zod or JSON Schema, auto-detected) */
|
|
@@ -1401,6 +1459,28 @@ declare class Evolve extends EventEmitter {
|
|
|
1401
1459
|
* Configure MCP servers
|
|
1402
1460
|
*/
|
|
1403
1461
|
withMcpServers(servers: Record<string, McpServerConfig>): this;
|
|
1462
|
+
/**
|
|
1463
|
+
* Enable browser automation.
|
|
1464
|
+
*
|
|
1465
|
+
* Gateway mode supports "browser-use", exposed as the same MCP server that
|
|
1466
|
+
* was previously included automatically.
|
|
1467
|
+
*
|
|
1468
|
+
* @example
|
|
1469
|
+
* kit.withBrowser("browser-use") // explicit provider
|
|
1470
|
+
*
|
|
1471
|
+
* @example
|
|
1472
|
+
* kit.withBrowser() // defaults to "browser-use"
|
|
1473
|
+
*/
|
|
1474
|
+
withBrowser(provider?: BrowserProvider | false): this;
|
|
1475
|
+
/**
|
|
1476
|
+
* Install agent plugins/extensions in the sandbox user profile.
|
|
1477
|
+
*
|
|
1478
|
+
* The selected agent determines the installer:
|
|
1479
|
+
* - droid/claude: { marketplace, plugin }
|
|
1480
|
+
* - gemini: { source, ref? }
|
|
1481
|
+
* - codex: { marketplace, ref?, sparse? }
|
|
1482
|
+
*/
|
|
1483
|
+
withPlugins(plugins: AgentPluginConfig | AgentPluginConfig[]): this;
|
|
1404
1484
|
/**
|
|
1405
1485
|
* Enable skills for the agent
|
|
1406
1486
|
*
|
|
@@ -2527,6 +2607,7 @@ interface BuildCommandOptions {
|
|
|
2527
2607
|
prompt: string;
|
|
2528
2608
|
model: string;
|
|
2529
2609
|
isResume: boolean;
|
|
2610
|
+
sessionId?: string;
|
|
2530
2611
|
reasoningEffort?: string;
|
|
2531
2612
|
isDirectMode?: boolean;
|
|
2532
2613
|
/** Skills enabled for this run */
|
|
@@ -2546,8 +2627,8 @@ interface AgentRegistryEntry {
|
|
|
2546
2627
|
key: string;
|
|
2547
2628
|
value: string;
|
|
2548
2629
|
};
|
|
2549
|
-
/** Environment variable name for base URL */
|
|
2550
|
-
baseUrlEnv
|
|
2630
|
+
/** Environment variable name for base URL, if this CLI supports one */
|
|
2631
|
+
baseUrlEnv?: string;
|
|
2551
2632
|
/** Default model alias */
|
|
2552
2633
|
defaultModel: string;
|
|
2553
2634
|
/** Available models for this agent */
|
|
@@ -2574,6 +2655,19 @@ interface AgentRegistryEntry {
|
|
|
2574
2655
|
}>;
|
|
2575
2656
|
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
2576
2657
|
gatewayConfigEnv?: string;
|
|
2658
|
+
/** Gateway-only model aliases for CLIs whose native model IDs differ from LiteLLM route names */
|
|
2659
|
+
gatewayModelAliases?: Record<string, string>;
|
|
2660
|
+
/** Direct-mode model aliases for CLIs whose public model names differ from CLI-native model IDs */
|
|
2661
|
+
directModelAliases?: Record<string, string>;
|
|
2662
|
+
/** Do not set provider API key env in gateway mode (used when routing via generated settings instead) */
|
|
2663
|
+
skipApiKeyEnvInGateway?: boolean;
|
|
2664
|
+
/** Dedicated Droid settings file for Evolve gateway custom model routing */
|
|
2665
|
+
droidGatewaySettings?: {
|
|
2666
|
+
settingsPath: string;
|
|
2667
|
+
displayName: string;
|
|
2668
|
+
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
2669
|
+
maxOutputTokens?: number;
|
|
2670
|
+
};
|
|
2577
2671
|
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2578
2672
|
customHeadersEnv?: string;
|
|
2579
2673
|
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
@@ -2652,7 +2746,7 @@ declare function getMcpSettingsDir(agentType: AgentType): string;
|
|
|
2652
2746
|
/**
|
|
2653
2747
|
* MCP JSON Configuration Writer
|
|
2654
2748
|
*
|
|
2655
|
-
* Handles MCP config for Claude, Gemini, Qwen, and
|
|
2749
|
+
* Handles MCP config for Claude, Gemini, Qwen, Kimi, Droid, and OpenCode agents.
|
|
2656
2750
|
* Uses registry for paths - no hardcoded values.
|
|
2657
2751
|
*
|
|
2658
2752
|
* Transport formats by agent:
|
|
@@ -2674,6 +2768,29 @@ declare function writeClaudeMcpConfig(sandbox: SandboxInstance, workingDir: stri
|
|
|
2674
2768
|
declare function writeGeminiMcpConfig(sandbox: SandboxInstance, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2675
2769
|
/** Write MCP config for Qwen agent */
|
|
2676
2770
|
declare function writeQwenMcpConfig(sandbox: SandboxInstance, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2771
|
+
/**
|
|
2772
|
+
* Write MCP config for Droid agent
|
|
2773
|
+
*
|
|
2774
|
+
* Droid supports project-level `.factory/mcp.json`, which keeps MCP config
|
|
2775
|
+
* scoped to the sandbox workspace instead of mutating global user config.
|
|
2776
|
+
*/
|
|
2777
|
+
declare function writeDroidMcpConfig(sandbox: SandboxInstance, workingDir: string, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
2778
|
+
interface DroidGatewaySettingsConfig {
|
|
2779
|
+
settingsPath: string;
|
|
2780
|
+
displayName: string;
|
|
2781
|
+
model: string;
|
|
2782
|
+
baseUrl: string;
|
|
2783
|
+
apiKeyEnv: string;
|
|
2784
|
+
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
2785
|
+
maxOutputTokens?: number;
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Write an Evolve-owned Droid settings file for gateway custom-model routing.
|
|
2789
|
+
*
|
|
2790
|
+
* The command passes this file with `droid --settings`, so it does not alter the
|
|
2791
|
+
* user's normal ~/.factory/settings.json inside the sandbox.
|
|
2792
|
+
*/
|
|
2793
|
+
declare function writeDroidGatewaySettings(sandbox: SandboxInstance, config: DroidGatewaySettingsConfig, headers: Record<string, string>): Promise<void>;
|
|
2677
2794
|
|
|
2678
2795
|
/**
|
|
2679
2796
|
* MCP TOML Configuration Writer
|
|
@@ -2705,6 +2822,7 @@ declare function writeCodexMcpConfig(sandbox: SandboxInstance, servers: Record<s
|
|
|
2705
2822
|
* - Codex: TOML to ~/.codex/config.toml
|
|
2706
2823
|
* - Gemini: JSON to ~/.gemini/settings.json
|
|
2707
2824
|
* - Qwen: JSON to ~/.qwen/settings.json
|
|
2825
|
+
* - Droid: JSON to ${workingDir}/.factory/mcp.json
|
|
2708
2826
|
* - OpenCode: JSON to ${workingDir}/opencode.json (mcp key)
|
|
2709
2827
|
*/
|
|
2710
2828
|
declare function writeMcpConfig(agentType: AgentType, sandbox: SandboxInstance, workingDir: string, servers: Record<string, McpServerConfig>): Promise<void>;
|
|
@@ -2951,4 +3069,4 @@ interface SessionsClient {
|
|
|
2951
3069
|
*/
|
|
2952
3070
|
declare function sessions(config?: SessionsConfig): SessionsClient;
|
|
2953
3071
|
|
|
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 };
|
|
3072
|
+
export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentPluginConfig, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type BrowserProvider, type CandidateCompleteEvent, type CheckpointInfo, type CodexAgentPluginConfig, 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 GeminiAgentPluginConfig, 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 MarketplaceAgentPluginConfig, 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, createDroidParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, sessions, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeDroidGatewaySettings, writeDroidMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
|