@evolvingmachines/sdk 0.0.28 → 0.0.30
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.cjs +66 -46
- package/dist/index.d.cts +232 -21
- package/dist/index.d.ts +232 -21
- package/dist/index.js +66 -46
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -581,6 +581,8 @@ interface SessionStatus {
|
|
|
581
581
|
interface AgentResponse {
|
|
582
582
|
/** Sandbox ID for session management */
|
|
583
583
|
sandboxId: string;
|
|
584
|
+
/** Run ID for spend/cost attribution (present for run(), undefined for executeCommand()) */
|
|
585
|
+
runId?: string;
|
|
584
586
|
/** Exit code of the command */
|
|
585
587
|
exitCode: number;
|
|
586
588
|
/** Standard output */
|
|
@@ -590,6 +592,50 @@ interface AgentResponse {
|
|
|
590
592
|
/** Checkpoint info if storage configured and run succeeded (undefined otherwise) */
|
|
591
593
|
checkpoint?: CheckpointInfo;
|
|
592
594
|
}
|
|
595
|
+
/** Cost breakdown for a single run() invocation */
|
|
596
|
+
interface RunCost {
|
|
597
|
+
/** Run ID matching AgentResponse.runId */
|
|
598
|
+
runId: string;
|
|
599
|
+
/** 1-based chronological position in session */
|
|
600
|
+
index: number;
|
|
601
|
+
/** Total cost in USD (includes platform margin) */
|
|
602
|
+
cost: number;
|
|
603
|
+
/** Token counts */
|
|
604
|
+
tokens: {
|
|
605
|
+
prompt: number;
|
|
606
|
+
completion: number;
|
|
607
|
+
};
|
|
608
|
+
/** Model used (e.g., "claude-opus-4-6"). Last observed model if multiple models used in a run. */
|
|
609
|
+
model: string;
|
|
610
|
+
/** Number of LLM API requests in this run */
|
|
611
|
+
requests: number;
|
|
612
|
+
/** ISO timestamp when this data was fetched */
|
|
613
|
+
asOf: string;
|
|
614
|
+
/** False if recent LLM calls may still be batching (~60s delay) */
|
|
615
|
+
isComplete: boolean;
|
|
616
|
+
/** True if spend log pagination was capped — totals may be understated */
|
|
617
|
+
truncated: boolean;
|
|
618
|
+
}
|
|
619
|
+
/** Cost breakdown for an entire agent session (all runs) */
|
|
620
|
+
interface SessionCost {
|
|
621
|
+
/** Session tag matching agent.getSessionTag() */
|
|
622
|
+
sessionTag: string;
|
|
623
|
+
/** Total cost across all runs in USD */
|
|
624
|
+
totalCost: number;
|
|
625
|
+
/** Aggregate token counts */
|
|
626
|
+
totalTokens: {
|
|
627
|
+
prompt: number;
|
|
628
|
+
completion: number;
|
|
629
|
+
};
|
|
630
|
+
/** Per-run breakdown, chronological order */
|
|
631
|
+
runs: RunCost[];
|
|
632
|
+
/** ISO timestamp when this data was fetched */
|
|
633
|
+
asOf: string;
|
|
634
|
+
/** False if session is still active or recently ended */
|
|
635
|
+
isComplete: boolean;
|
|
636
|
+
/** True if spend log pagination was capped — totals may be understated */
|
|
637
|
+
truncated: boolean;
|
|
638
|
+
}
|
|
593
639
|
/** Result from getOutputFiles() with optional schema validation */
|
|
594
640
|
interface OutputResult<T = unknown> {
|
|
595
641
|
/** Output files from output/ folder */
|
|
@@ -747,6 +793,43 @@ interface CheckpointInfo {
|
|
|
747
793
|
/** User-provided label for this checkpoint */
|
|
748
794
|
comment?: string;
|
|
749
795
|
}
|
|
796
|
+
/** Options for StorageClient.downloadCheckpoint() */
|
|
797
|
+
interface DownloadCheckpointOptions {
|
|
798
|
+
/** Local directory to save to (default: current working directory) */
|
|
799
|
+
to?: string;
|
|
800
|
+
/** Extract the archive (default: true). If false, saves the raw .tar.gz file. */
|
|
801
|
+
extract?: boolean;
|
|
802
|
+
}
|
|
803
|
+
/** Options for StorageClient.downloadFiles() */
|
|
804
|
+
interface DownloadFilesOptions {
|
|
805
|
+
/** Specific file paths to extract (relative to archive root, e.g., "workspace/output/result.json") */
|
|
806
|
+
files?: string[];
|
|
807
|
+
/** Glob patterns to match files (e.g., ["workspace/output/*.json"]) */
|
|
808
|
+
glob?: string[];
|
|
809
|
+
/** Local directory to save files to. If omitted, files are returned in-memory only. */
|
|
810
|
+
to?: string;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Storage client for browsing and fetching checkpoints without an Evolve instance.
|
|
814
|
+
*
|
|
815
|
+
* @example
|
|
816
|
+
* const s = storage({ url: "s3://my-bucket/prefix/" });
|
|
817
|
+
* const checkpoints = await s.listCheckpoints({ tag: "poker-agent" });
|
|
818
|
+
* const files = await s.downloadFiles("latest", { glob: ["workspace/output/*.json"] });
|
|
819
|
+
*/
|
|
820
|
+
interface StorageClient {
|
|
821
|
+
/** List checkpoints with optional filtering */
|
|
822
|
+
listCheckpoints(options?: {
|
|
823
|
+
limit?: number;
|
|
824
|
+
tag?: string;
|
|
825
|
+
}): Promise<CheckpointInfo[]>;
|
|
826
|
+
/** Get a specific checkpoint's metadata by ID */
|
|
827
|
+
getCheckpoint(id: string): Promise<CheckpointInfo>;
|
|
828
|
+
/** Download an entire checkpoint archive. Returns the output path. */
|
|
829
|
+
downloadCheckpoint(idOrLatest: string, options?: DownloadCheckpointOptions): Promise<string>;
|
|
830
|
+
/** Download files from a checkpoint as a FileMap. */
|
|
831
|
+
downloadFiles(idOrLatest: string, options?: DownloadFilesOptions): Promise<FileMap>;
|
|
832
|
+
}
|
|
750
833
|
|
|
751
834
|
/**
|
|
752
835
|
* Composio Auth Helpers
|
|
@@ -845,6 +928,10 @@ declare class Agent {
|
|
|
845
928
|
private readonly workingDir;
|
|
846
929
|
private lastRunTimestamp?;
|
|
847
930
|
private readonly registry;
|
|
931
|
+
/** Unified session ID — used for both observability (SessionLogger) and spend tracking (LiteLLM customer-id) */
|
|
932
|
+
private sessionTag;
|
|
933
|
+
/** Previous session tag — preserved across kill()/setSession() so cost queries still work */
|
|
934
|
+
private previousSessionTag?;
|
|
848
935
|
private sessionLogger?;
|
|
849
936
|
private activeCommand?;
|
|
850
937
|
private activeProcessId;
|
|
@@ -879,6 +966,25 @@ declare class Agent {
|
|
|
879
966
|
* Build environment variables for sandbox
|
|
880
967
|
*/
|
|
881
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;
|
|
981
|
+
/**
|
|
982
|
+
* Build per-run env overrides for spend tracking.
|
|
983
|
+
* Merges session + run headers into the custom headers env var,
|
|
984
|
+
* or sets per-env-var values for agents using spendTrackingEnvs.
|
|
985
|
+
* Passed to spawn() so each .run() gets a unique run tag.
|
|
986
|
+
*/
|
|
987
|
+
private buildRunEnvs;
|
|
882
988
|
/**
|
|
883
989
|
* Agent-specific authentication setup
|
|
884
990
|
*/
|
|
@@ -987,9 +1093,9 @@ declare class Agent {
|
|
|
987
1093
|
*/
|
|
988
1094
|
getAgentType(): AgentType;
|
|
989
1095
|
/**
|
|
990
|
-
* Get current session tag
|
|
991
|
-
*
|
|
992
|
-
*
|
|
1096
|
+
* Get current session tag.
|
|
1097
|
+
* Returns null if no active session (before sandbox creation or after kill()).
|
|
1098
|
+
* Used for both observability (dashboard traces) and spend tracking (LiteLLM customer-id).
|
|
993
1099
|
*/
|
|
994
1100
|
getSessionTag(): string | null;
|
|
995
1101
|
/**
|
|
@@ -1002,6 +1108,58 @@ declare class Agent {
|
|
|
1002
1108
|
* Flush pending observability events without closing the session.
|
|
1003
1109
|
*/
|
|
1004
1110
|
flushObservability(): Promise<void>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Tear down the session logger and rotate the session tag.
|
|
1113
|
+
* Preserves `previousSessionTag` only if this session had actual activity,
|
|
1114
|
+
* so a double kill() or no-op lifecycle call doesn't clobber the real tag.
|
|
1115
|
+
* @internal
|
|
1116
|
+
*/
|
|
1117
|
+
private rotateSession;
|
|
1118
|
+
/**
|
|
1119
|
+
* Fetch spend data from dashboard API.
|
|
1120
|
+
* @internal
|
|
1121
|
+
*/
|
|
1122
|
+
private fetchSpend;
|
|
1123
|
+
/**
|
|
1124
|
+
* Resolve the session tag for cost queries.
|
|
1125
|
+
* Uses the active session tag, or falls back to the previous tag after kill()/setSession().
|
|
1126
|
+
* @internal
|
|
1127
|
+
*/
|
|
1128
|
+
private resolveSpendTag;
|
|
1129
|
+
/**
|
|
1130
|
+
* Normalize run payloads for compatibility with older dashboard responses.
|
|
1131
|
+
* Older responses may omit `asOf`, `isComplete`, or `truncated` inside `runs[]`.
|
|
1132
|
+
* @internal
|
|
1133
|
+
*/
|
|
1134
|
+
private normalizeRunCost;
|
|
1135
|
+
/**
|
|
1136
|
+
* Normalize session payloads so all `runs[]` conform to `RunCost`.
|
|
1137
|
+
* @internal
|
|
1138
|
+
*/
|
|
1139
|
+
private normalizeSessionCost;
|
|
1140
|
+
/**
|
|
1141
|
+
* Get cost breakdown for the current session (all runs).
|
|
1142
|
+
*
|
|
1143
|
+
* Queries the dashboard API which proxies to LiteLLM spend logs.
|
|
1144
|
+
* Cost data has ~60s latency due to gateway batch writes.
|
|
1145
|
+
* Also works after kill() for the most recent session only.
|
|
1146
|
+
*
|
|
1147
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1148
|
+
*/
|
|
1149
|
+
getSessionCost(): Promise<SessionCost>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Get cost for a specific run by ID or index.
|
|
1152
|
+
*
|
|
1153
|
+
* @param run - Either `{ runId: string }` or `{ index: number }` (1-based, negative = from end)
|
|
1154
|
+
*
|
|
1155
|
+
* Also works after kill() for the most recent session only.
|
|
1156
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1157
|
+
*/
|
|
1158
|
+
getRunCost(run: {
|
|
1159
|
+
runId: string;
|
|
1160
|
+
} | {
|
|
1161
|
+
index: number;
|
|
1162
|
+
}): Promise<RunCost>;
|
|
1005
1163
|
}
|
|
1006
1164
|
|
|
1007
1165
|
/**
|
|
@@ -1419,6 +1577,12 @@ declare class Evolve extends EventEmitter {
|
|
|
1419
1577
|
checkpoint(options?: {
|
|
1420
1578
|
comment?: string;
|
|
1421
1579
|
}): Promise<CheckpointInfo>;
|
|
1580
|
+
private _cachedGatewayOverrides;
|
|
1581
|
+
/**
|
|
1582
|
+
* Resolve gateway credentials from agent config for storage operations.
|
|
1583
|
+
* Memoized — agent config is immutable after .withAgent().
|
|
1584
|
+
*/
|
|
1585
|
+
private resolveGatewayOverrides;
|
|
1422
1586
|
/**
|
|
1423
1587
|
* List checkpoints (requires .withStorage()).
|
|
1424
1588
|
*
|
|
@@ -1431,6 +1595,11 @@ declare class Evolve extends EventEmitter {
|
|
|
1431
1595
|
limit?: number;
|
|
1432
1596
|
tag?: string;
|
|
1433
1597
|
}): Promise<CheckpointInfo[]>;
|
|
1598
|
+
/**
|
|
1599
|
+
* Get a StorageClient bound to this instance's storage configuration.
|
|
1600
|
+
* Same API surface as the standalone storage() factory.
|
|
1601
|
+
*/
|
|
1602
|
+
storage(): StorageClient;
|
|
1434
1603
|
/**
|
|
1435
1604
|
* Get current session (sandbox ID)
|
|
1436
1605
|
*/
|
|
@@ -1475,6 +1644,21 @@ declare class Evolve extends EventEmitter {
|
|
|
1475
1644
|
* Flush pending observability events without killing sandbox.
|
|
1476
1645
|
*/
|
|
1477
1646
|
flushObservability(): Promise<void>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Get cost breakdown for the current session (all runs).
|
|
1649
|
+
* Also works after kill() — queries the just-finished session.
|
|
1650
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1651
|
+
*/
|
|
1652
|
+
getSessionCost(): Promise<SessionCost>;
|
|
1653
|
+
/**
|
|
1654
|
+
* Get cost for a specific run by ID or index.
|
|
1655
|
+
* @param run - Either `{ runId: string }` or `{ index: number }` (1-based, negative = from end)
|
|
1656
|
+
*/
|
|
1657
|
+
getRunCost(run: {
|
|
1658
|
+
runId: string;
|
|
1659
|
+
} | {
|
|
1660
|
+
index: number;
|
|
1661
|
+
}): Promise<RunCost>;
|
|
1478
1662
|
}
|
|
1479
1663
|
|
|
1480
1664
|
/**
|
|
@@ -2392,6 +2576,49 @@ interface AgentRegistryEntry {
|
|
|
2392
2576
|
}>;
|
|
2393
2577
|
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
2394
2578
|
gatewayConfigEnv?: string;
|
|
2579
|
+
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2580
|
+
customHeadersEnv?: string;
|
|
2581
|
+
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
2582
|
+
customHeadersFormat?: "newline" | "comma";
|
|
2583
|
+
/**
|
|
2584
|
+
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
2585
|
+
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
2586
|
+
* reads at request time. Alternative to customHeadersEnv for agents without a
|
|
2587
|
+
* single custom-headers env var.
|
|
2588
|
+
*/
|
|
2589
|
+
spendTrackingEnvs?: {
|
|
2590
|
+
/** Env var name for x-litellm-customer-id value */
|
|
2591
|
+
sessionTagEnv: string;
|
|
2592
|
+
/** Env var name for x-litellm-tags value */
|
|
2593
|
+
runTagEnv: string;
|
|
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
|
+
};
|
|
2395
2622
|
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
2396
2623
|
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
2397
2624
|
checkpointDirs?: string[];
|
|
@@ -2636,22 +2863,6 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
|
|
|
2636
2863
|
* Gateway mode: no URL → use dashboard API endpoints
|
|
2637
2864
|
*/
|
|
2638
2865
|
declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
|
|
2639
|
-
|
|
2640
|
-
* List checkpoints (standalone — no Evolve instance needed).
|
|
2641
|
-
*
|
|
2642
|
-
* BYOK mode: reads directly from S3.
|
|
2643
|
-
* Gateway mode: reads EVOLVE_API_KEY from env, calls dashboard API.
|
|
2644
|
-
*
|
|
2645
|
-
* @example
|
|
2646
|
-
* // BYOK
|
|
2647
|
-
* const all = await listCheckpoints({ url: "s3://my-bucket/project/" });
|
|
2648
|
-
*
|
|
2649
|
-
* // Gateway
|
|
2650
|
-
* const all = await listCheckpoints({});
|
|
2651
|
-
*/
|
|
2652
|
-
declare function listCheckpoints(config: StorageConfig, options?: {
|
|
2653
|
-
limit?: number;
|
|
2654
|
-
tag?: string;
|
|
2655
|
-
}): Promise<CheckpointInfo[]>;
|
|
2866
|
+
declare function storage(config?: StorageConfig): StorageClient;
|
|
2656
2867
|
|
|
2657
|
-
export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type CheckpointInfo, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type ResolvedStorageConfig, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageConfig, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -581,6 +581,8 @@ interface SessionStatus {
|
|
|
581
581
|
interface AgentResponse {
|
|
582
582
|
/** Sandbox ID for session management */
|
|
583
583
|
sandboxId: string;
|
|
584
|
+
/** Run ID for spend/cost attribution (present for run(), undefined for executeCommand()) */
|
|
585
|
+
runId?: string;
|
|
584
586
|
/** Exit code of the command */
|
|
585
587
|
exitCode: number;
|
|
586
588
|
/** Standard output */
|
|
@@ -590,6 +592,50 @@ interface AgentResponse {
|
|
|
590
592
|
/** Checkpoint info if storage configured and run succeeded (undefined otherwise) */
|
|
591
593
|
checkpoint?: CheckpointInfo;
|
|
592
594
|
}
|
|
595
|
+
/** Cost breakdown for a single run() invocation */
|
|
596
|
+
interface RunCost {
|
|
597
|
+
/** Run ID matching AgentResponse.runId */
|
|
598
|
+
runId: string;
|
|
599
|
+
/** 1-based chronological position in session */
|
|
600
|
+
index: number;
|
|
601
|
+
/** Total cost in USD (includes platform margin) */
|
|
602
|
+
cost: number;
|
|
603
|
+
/** Token counts */
|
|
604
|
+
tokens: {
|
|
605
|
+
prompt: number;
|
|
606
|
+
completion: number;
|
|
607
|
+
};
|
|
608
|
+
/** Model used (e.g., "claude-opus-4-6"). Last observed model if multiple models used in a run. */
|
|
609
|
+
model: string;
|
|
610
|
+
/** Number of LLM API requests in this run */
|
|
611
|
+
requests: number;
|
|
612
|
+
/** ISO timestamp when this data was fetched */
|
|
613
|
+
asOf: string;
|
|
614
|
+
/** False if recent LLM calls may still be batching (~60s delay) */
|
|
615
|
+
isComplete: boolean;
|
|
616
|
+
/** True if spend log pagination was capped — totals may be understated */
|
|
617
|
+
truncated: boolean;
|
|
618
|
+
}
|
|
619
|
+
/** Cost breakdown for an entire agent session (all runs) */
|
|
620
|
+
interface SessionCost {
|
|
621
|
+
/** Session tag matching agent.getSessionTag() */
|
|
622
|
+
sessionTag: string;
|
|
623
|
+
/** Total cost across all runs in USD */
|
|
624
|
+
totalCost: number;
|
|
625
|
+
/** Aggregate token counts */
|
|
626
|
+
totalTokens: {
|
|
627
|
+
prompt: number;
|
|
628
|
+
completion: number;
|
|
629
|
+
};
|
|
630
|
+
/** Per-run breakdown, chronological order */
|
|
631
|
+
runs: RunCost[];
|
|
632
|
+
/** ISO timestamp when this data was fetched */
|
|
633
|
+
asOf: string;
|
|
634
|
+
/** False if session is still active or recently ended */
|
|
635
|
+
isComplete: boolean;
|
|
636
|
+
/** True if spend log pagination was capped — totals may be understated */
|
|
637
|
+
truncated: boolean;
|
|
638
|
+
}
|
|
593
639
|
/** Result from getOutputFiles() with optional schema validation */
|
|
594
640
|
interface OutputResult<T = unknown> {
|
|
595
641
|
/** Output files from output/ folder */
|
|
@@ -747,6 +793,43 @@ interface CheckpointInfo {
|
|
|
747
793
|
/** User-provided label for this checkpoint */
|
|
748
794
|
comment?: string;
|
|
749
795
|
}
|
|
796
|
+
/** Options for StorageClient.downloadCheckpoint() */
|
|
797
|
+
interface DownloadCheckpointOptions {
|
|
798
|
+
/** Local directory to save to (default: current working directory) */
|
|
799
|
+
to?: string;
|
|
800
|
+
/** Extract the archive (default: true). If false, saves the raw .tar.gz file. */
|
|
801
|
+
extract?: boolean;
|
|
802
|
+
}
|
|
803
|
+
/** Options for StorageClient.downloadFiles() */
|
|
804
|
+
interface DownloadFilesOptions {
|
|
805
|
+
/** Specific file paths to extract (relative to archive root, e.g., "workspace/output/result.json") */
|
|
806
|
+
files?: string[];
|
|
807
|
+
/** Glob patterns to match files (e.g., ["workspace/output/*.json"]) */
|
|
808
|
+
glob?: string[];
|
|
809
|
+
/** Local directory to save files to. If omitted, files are returned in-memory only. */
|
|
810
|
+
to?: string;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Storage client for browsing and fetching checkpoints without an Evolve instance.
|
|
814
|
+
*
|
|
815
|
+
* @example
|
|
816
|
+
* const s = storage({ url: "s3://my-bucket/prefix/" });
|
|
817
|
+
* const checkpoints = await s.listCheckpoints({ tag: "poker-agent" });
|
|
818
|
+
* const files = await s.downloadFiles("latest", { glob: ["workspace/output/*.json"] });
|
|
819
|
+
*/
|
|
820
|
+
interface StorageClient {
|
|
821
|
+
/** List checkpoints with optional filtering */
|
|
822
|
+
listCheckpoints(options?: {
|
|
823
|
+
limit?: number;
|
|
824
|
+
tag?: string;
|
|
825
|
+
}): Promise<CheckpointInfo[]>;
|
|
826
|
+
/** Get a specific checkpoint's metadata by ID */
|
|
827
|
+
getCheckpoint(id: string): Promise<CheckpointInfo>;
|
|
828
|
+
/** Download an entire checkpoint archive. Returns the output path. */
|
|
829
|
+
downloadCheckpoint(idOrLatest: string, options?: DownloadCheckpointOptions): Promise<string>;
|
|
830
|
+
/** Download files from a checkpoint as a FileMap. */
|
|
831
|
+
downloadFiles(idOrLatest: string, options?: DownloadFilesOptions): Promise<FileMap>;
|
|
832
|
+
}
|
|
750
833
|
|
|
751
834
|
/**
|
|
752
835
|
* Composio Auth Helpers
|
|
@@ -845,6 +928,10 @@ declare class Agent {
|
|
|
845
928
|
private readonly workingDir;
|
|
846
929
|
private lastRunTimestamp?;
|
|
847
930
|
private readonly registry;
|
|
931
|
+
/** Unified session ID — used for both observability (SessionLogger) and spend tracking (LiteLLM customer-id) */
|
|
932
|
+
private sessionTag;
|
|
933
|
+
/** Previous session tag — preserved across kill()/setSession() so cost queries still work */
|
|
934
|
+
private previousSessionTag?;
|
|
848
935
|
private sessionLogger?;
|
|
849
936
|
private activeCommand?;
|
|
850
937
|
private activeProcessId;
|
|
@@ -879,6 +966,25 @@ declare class Agent {
|
|
|
879
966
|
* Build environment variables for sandbox
|
|
880
967
|
*/
|
|
881
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;
|
|
981
|
+
/**
|
|
982
|
+
* Build per-run env overrides for spend tracking.
|
|
983
|
+
* Merges session + run headers into the custom headers env var,
|
|
984
|
+
* or sets per-env-var values for agents using spendTrackingEnvs.
|
|
985
|
+
* Passed to spawn() so each .run() gets a unique run tag.
|
|
986
|
+
*/
|
|
987
|
+
private buildRunEnvs;
|
|
882
988
|
/**
|
|
883
989
|
* Agent-specific authentication setup
|
|
884
990
|
*/
|
|
@@ -987,9 +1093,9 @@ declare class Agent {
|
|
|
987
1093
|
*/
|
|
988
1094
|
getAgentType(): AgentType;
|
|
989
1095
|
/**
|
|
990
|
-
* Get current session tag
|
|
991
|
-
*
|
|
992
|
-
*
|
|
1096
|
+
* Get current session tag.
|
|
1097
|
+
* Returns null if no active session (before sandbox creation or after kill()).
|
|
1098
|
+
* Used for both observability (dashboard traces) and spend tracking (LiteLLM customer-id).
|
|
993
1099
|
*/
|
|
994
1100
|
getSessionTag(): string | null;
|
|
995
1101
|
/**
|
|
@@ -1002,6 +1108,58 @@ declare class Agent {
|
|
|
1002
1108
|
* Flush pending observability events without closing the session.
|
|
1003
1109
|
*/
|
|
1004
1110
|
flushObservability(): Promise<void>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Tear down the session logger and rotate the session tag.
|
|
1113
|
+
* Preserves `previousSessionTag` only if this session had actual activity,
|
|
1114
|
+
* so a double kill() or no-op lifecycle call doesn't clobber the real tag.
|
|
1115
|
+
* @internal
|
|
1116
|
+
*/
|
|
1117
|
+
private rotateSession;
|
|
1118
|
+
/**
|
|
1119
|
+
* Fetch spend data from dashboard API.
|
|
1120
|
+
* @internal
|
|
1121
|
+
*/
|
|
1122
|
+
private fetchSpend;
|
|
1123
|
+
/**
|
|
1124
|
+
* Resolve the session tag for cost queries.
|
|
1125
|
+
* Uses the active session tag, or falls back to the previous tag after kill()/setSession().
|
|
1126
|
+
* @internal
|
|
1127
|
+
*/
|
|
1128
|
+
private resolveSpendTag;
|
|
1129
|
+
/**
|
|
1130
|
+
* Normalize run payloads for compatibility with older dashboard responses.
|
|
1131
|
+
* Older responses may omit `asOf`, `isComplete`, or `truncated` inside `runs[]`.
|
|
1132
|
+
* @internal
|
|
1133
|
+
*/
|
|
1134
|
+
private normalizeRunCost;
|
|
1135
|
+
/**
|
|
1136
|
+
* Normalize session payloads so all `runs[]` conform to `RunCost`.
|
|
1137
|
+
* @internal
|
|
1138
|
+
*/
|
|
1139
|
+
private normalizeSessionCost;
|
|
1140
|
+
/**
|
|
1141
|
+
* Get cost breakdown for the current session (all runs).
|
|
1142
|
+
*
|
|
1143
|
+
* Queries the dashboard API which proxies to LiteLLM spend logs.
|
|
1144
|
+
* Cost data has ~60s latency due to gateway batch writes.
|
|
1145
|
+
* Also works after kill() for the most recent session only.
|
|
1146
|
+
*
|
|
1147
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1148
|
+
*/
|
|
1149
|
+
getSessionCost(): Promise<SessionCost>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Get cost for a specific run by ID or index.
|
|
1152
|
+
*
|
|
1153
|
+
* @param run - Either `{ runId: string }` or `{ index: number }` (1-based, negative = from end)
|
|
1154
|
+
*
|
|
1155
|
+
* Also works after kill() for the most recent session only.
|
|
1156
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1157
|
+
*/
|
|
1158
|
+
getRunCost(run: {
|
|
1159
|
+
runId: string;
|
|
1160
|
+
} | {
|
|
1161
|
+
index: number;
|
|
1162
|
+
}): Promise<RunCost>;
|
|
1005
1163
|
}
|
|
1006
1164
|
|
|
1007
1165
|
/**
|
|
@@ -1419,6 +1577,12 @@ declare class Evolve extends EventEmitter {
|
|
|
1419
1577
|
checkpoint(options?: {
|
|
1420
1578
|
comment?: string;
|
|
1421
1579
|
}): Promise<CheckpointInfo>;
|
|
1580
|
+
private _cachedGatewayOverrides;
|
|
1581
|
+
/**
|
|
1582
|
+
* Resolve gateway credentials from agent config for storage operations.
|
|
1583
|
+
* Memoized — agent config is immutable after .withAgent().
|
|
1584
|
+
*/
|
|
1585
|
+
private resolveGatewayOverrides;
|
|
1422
1586
|
/**
|
|
1423
1587
|
* List checkpoints (requires .withStorage()).
|
|
1424
1588
|
*
|
|
@@ -1431,6 +1595,11 @@ declare class Evolve extends EventEmitter {
|
|
|
1431
1595
|
limit?: number;
|
|
1432
1596
|
tag?: string;
|
|
1433
1597
|
}): Promise<CheckpointInfo[]>;
|
|
1598
|
+
/**
|
|
1599
|
+
* Get a StorageClient bound to this instance's storage configuration.
|
|
1600
|
+
* Same API surface as the standalone storage() factory.
|
|
1601
|
+
*/
|
|
1602
|
+
storage(): StorageClient;
|
|
1434
1603
|
/**
|
|
1435
1604
|
* Get current session (sandbox ID)
|
|
1436
1605
|
*/
|
|
@@ -1475,6 +1644,21 @@ declare class Evolve extends EventEmitter {
|
|
|
1475
1644
|
* Flush pending observability events without killing sandbox.
|
|
1476
1645
|
*/
|
|
1477
1646
|
flushObservability(): Promise<void>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Get cost breakdown for the current session (all runs).
|
|
1649
|
+
* Also works after kill() — queries the just-finished session.
|
|
1650
|
+
* Requires gateway mode (EVOLVE_API_KEY).
|
|
1651
|
+
*/
|
|
1652
|
+
getSessionCost(): Promise<SessionCost>;
|
|
1653
|
+
/**
|
|
1654
|
+
* Get cost for a specific run by ID or index.
|
|
1655
|
+
* @param run - Either `{ runId: string }` or `{ index: number }` (1-based, negative = from end)
|
|
1656
|
+
*/
|
|
1657
|
+
getRunCost(run: {
|
|
1658
|
+
runId: string;
|
|
1659
|
+
} | {
|
|
1660
|
+
index: number;
|
|
1661
|
+
}): Promise<RunCost>;
|
|
1478
1662
|
}
|
|
1479
1663
|
|
|
1480
1664
|
/**
|
|
@@ -2392,6 +2576,49 @@ interface AgentRegistryEntry {
|
|
|
2392
2576
|
}>;
|
|
2393
2577
|
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
2394
2578
|
gatewayConfigEnv?: string;
|
|
2579
|
+
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2580
|
+
customHeadersEnv?: string;
|
|
2581
|
+
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
2582
|
+
customHeadersFormat?: "newline" | "comma";
|
|
2583
|
+
/**
|
|
2584
|
+
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
2585
|
+
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
2586
|
+
* reads at request time. Alternative to customHeadersEnv for agents without a
|
|
2587
|
+
* single custom-headers env var.
|
|
2588
|
+
*/
|
|
2589
|
+
spendTrackingEnvs?: {
|
|
2590
|
+
/** Env var name for x-litellm-customer-id value */
|
|
2591
|
+
sessionTagEnv: string;
|
|
2592
|
+
/** Env var name for x-litellm-tags value */
|
|
2593
|
+
runTagEnv: string;
|
|
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
|
+
};
|
|
2395
2622
|
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
2396
2623
|
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
2397
2624
|
checkpointDirs?: string[];
|
|
@@ -2636,22 +2863,6 @@ declare function saveLocalDir(localPath: string, files: FileMap): void;
|
|
|
2636
2863
|
* Gateway mode: no URL → use dashboard API endpoints
|
|
2637
2864
|
*/
|
|
2638
2865
|
declare function resolveStorageConfig(config: StorageConfig | undefined, isGateway: boolean, gatewayUrl?: string, gatewayApiKey?: string): ResolvedStorageConfig;
|
|
2639
|
-
|
|
2640
|
-
* List checkpoints (standalone — no Evolve instance needed).
|
|
2641
|
-
*
|
|
2642
|
-
* BYOK mode: reads directly from S3.
|
|
2643
|
-
* Gateway mode: reads EVOLVE_API_KEY from env, calls dashboard API.
|
|
2644
|
-
*
|
|
2645
|
-
* @example
|
|
2646
|
-
* // BYOK
|
|
2647
|
-
* const all = await listCheckpoints({ url: "s3://my-bucket/project/" });
|
|
2648
|
-
*
|
|
2649
|
-
* // Gateway
|
|
2650
|
-
* const all = await listCheckpoints({});
|
|
2651
|
-
*/
|
|
2652
|
-
declare function listCheckpoints(config: StorageConfig, options?: {
|
|
2653
|
-
limit?: number;
|
|
2654
|
-
tag?: string;
|
|
2655
|
-
}): Promise<CheckpointInfo[]>;
|
|
2866
|
+
declare function storage(config?: StorageConfig): StorageClient;
|
|
2656
2867
|
|
|
2657
|
-
export { AGENT_REGISTRY, AGENT_TYPES, Agent, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type CandidateCompleteEvent, type CheckpointInfo, type ComposioAuthResult, type ComposioConfig, type ComposioConnectionStatus, type ComposioSetup, type EmitOption, type EventHandler, type EventName, Evolve, type EvolveConfig, type EvolveEvents, type ExecuteCommandOptions, type FileMap, type FilterConfig, type FilterParams, type IndexedMeta, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type MapConfig, type MapParams, type McpConfigInfo, type McpServerConfig, type ModelInfo, type OnCandidateCompleteCallback, type OnItemRetryCallback, type OnJudgeCompleteCallback, type OnVerifierCompleteCallback, type OnWorkerCompleteCallback, type OperationType, type OutputEvent, type OutputResult, Pipeline, type PipelineContext, type PipelineEventMap, type PipelineEvents, type PipelineResult, type ProcessInfo, type Prompt, type PromptFn, RETRY_FEEDBACK_PROMPT, type ReasoningEffort, type ReduceConfig, type ReduceMeta, type ReduceParams, type ReduceResult, type ResolvedStorageConfig, type RetryConfig, type RunOptions, SCHEMA_PROMPT, SWARM_RESULT_BRAND, SYSTEM_PROMPT, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, type SandboxFiles, type SandboxInstance, type SandboxLifecycleState, type SandboxProvider, type SandboxRunOptions, type SandboxSpawnOptions, type SchemaValidationOptions, Semaphore, type SessionStatus, type SkillName, type SkillsConfig, type StepCompleteEvent, type StepErrorEvent, type StepEvent, type StepResult, type StepStartEvent, type StorageConfig, type StreamCallbacks, Swarm, type SwarmConfig, type SwarmResult, SwarmResultList, TerminalPipeline, type ToolsFilter, VALIDATION_PRESETS, VERIFY_PROMPT, type ValidationMode, type VerifierCompleteEvent, type VerifyConfig, type VerifyDecision, type VerifyInfo, type VerifyMeta, WORKSPACE_PROMPT, WORKSPACE_SWE_PROMPT, type WorkerCompleteEvent, type WorkspaceMode, applyTemplate, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString,
|
|
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 };
|