@evolvingmachines/sdk 0.0.51 → 0.0.52
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 +438 -63
- package/dist/index.d.cts +221 -173
- package/dist/index.d.ts +221 -173
- package/dist/index.js +438 -63
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -285,6 +285,201 @@ interface OutputEvent {
|
|
|
285
285
|
update: SessionUpdate;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Agent Registry
|
|
290
|
+
*
|
|
291
|
+
* Single source of truth for agent-specific behavior.
|
|
292
|
+
* All differences between agents are data, not code.
|
|
293
|
+
*
|
|
294
|
+
* Evidence: sdk-rewrite-v3.md Agent Registry section
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
/** Model configuration */
|
|
298
|
+
interface ModelInfo {
|
|
299
|
+
/** Model alias (short name used with --model) */
|
|
300
|
+
alias: string;
|
|
301
|
+
/** Full model ID */
|
|
302
|
+
modelId: string;
|
|
303
|
+
/** What this model is best for */
|
|
304
|
+
description: string;
|
|
305
|
+
}
|
|
306
|
+
/** MCP configuration for an agent */
|
|
307
|
+
interface McpConfigInfo {
|
|
308
|
+
/** Settings directory (e.g., "~/.claude") */
|
|
309
|
+
settingsDir: string;
|
|
310
|
+
/** Config filename (e.g., "settings.json" or "config.toml") */
|
|
311
|
+
filename: string;
|
|
312
|
+
/** Config format */
|
|
313
|
+
format: "json" | "toml";
|
|
314
|
+
/** Whether to use workingDir for project-level config (Claude only) */
|
|
315
|
+
projectConfig?: boolean;
|
|
316
|
+
}
|
|
317
|
+
/** Options for building agent commands */
|
|
318
|
+
interface BuildCommandOptions {
|
|
319
|
+
prompt: string;
|
|
320
|
+
model: string;
|
|
321
|
+
isResume: boolean;
|
|
322
|
+
sessionId?: string;
|
|
323
|
+
reasoningEffort?: string;
|
|
324
|
+
isDirectMode?: boolean;
|
|
325
|
+
/** Skills enabled for this run */
|
|
326
|
+
skills?: string[];
|
|
327
|
+
}
|
|
328
|
+
interface AgentRegistryEntry {
|
|
329
|
+
/** Sandbox image/template identifier (provider maps to its own concept) */
|
|
330
|
+
image: string;
|
|
331
|
+
/** Environment variable name for API key */
|
|
332
|
+
apiKeyEnv: string;
|
|
333
|
+
/** Environment variable name for OAuth (file path or token depending on agent) */
|
|
334
|
+
oauthEnv?: string;
|
|
335
|
+
/** OAuth credentials filename (e.g., "auth.json" for Codex, "oauth_creds.json" for Gemini) */
|
|
336
|
+
oauthFileName?: string;
|
|
337
|
+
/** Environment variable to set when OAuth is active (e.g., GOOGLE_GENAI_USE_GCA=true for Gemini) */
|
|
338
|
+
oauthActivationEnv?: {
|
|
339
|
+
key: string;
|
|
340
|
+
value: string;
|
|
341
|
+
};
|
|
342
|
+
/** Environment variable name for base URL, if this CLI supports one */
|
|
343
|
+
baseUrlEnv?: string;
|
|
344
|
+
/** Default model alias */
|
|
345
|
+
defaultModel: string;
|
|
346
|
+
/** Available models for this agent */
|
|
347
|
+
models: ModelInfo[];
|
|
348
|
+
/** System prompt filename (e.g., "CLAUDE.md") */
|
|
349
|
+
systemPromptFile: string;
|
|
350
|
+
/** MCP configuration */
|
|
351
|
+
mcpConfig: McpConfigInfo;
|
|
352
|
+
/** Build the CLI command for this agent */
|
|
353
|
+
buildCommand: (opts: BuildCommandOptions) => string;
|
|
354
|
+
/** Extra setup step (e.g., codex login) */
|
|
355
|
+
setupCommand?: string;
|
|
356
|
+
/** Gateway path prefix for CLIs that use a provider-native passthrough endpoint */
|
|
357
|
+
gatewayPath?: string;
|
|
358
|
+
/** Default base URL for direct mode (only needed if provider requires specific endpoint, e.g., Qwen → Dashscope) */
|
|
359
|
+
defaultBaseUrl?: string;
|
|
360
|
+
/** Available beta headers for this agent (for reference) */
|
|
361
|
+
availableBetas?: Record<string, string>;
|
|
362
|
+
/** Skills configuration for this agent */
|
|
363
|
+
skillsConfig: SkillsConfig;
|
|
364
|
+
/** Multi-provider env mapping: model prefix → keyEnv (for CLIs like OpenCode that resolve provider from model string) */
|
|
365
|
+
providerEnvMap?: Record<string, {
|
|
366
|
+
keyEnv: string;
|
|
367
|
+
}>;
|
|
368
|
+
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
369
|
+
gatewayConfigEnv?: string;
|
|
370
|
+
/** Gateway-only model aliases for CLIs whose native model IDs differ from LiteLLM route names */
|
|
371
|
+
gatewayModelAliases?: Record<string, string>;
|
|
372
|
+
/** Direct-mode model aliases for CLIs whose public model names differ from CLI-native model IDs */
|
|
373
|
+
directModelAliases?: Record<string, string>;
|
|
374
|
+
/** Do not set provider API key env in gateway mode (used when routing via generated settings instead) */
|
|
375
|
+
skipApiKeyEnvInGateway?: boolean;
|
|
376
|
+
/** Dedicated Droid settings file for Evolve gateway custom model routing */
|
|
377
|
+
droidGatewaySettings?: {
|
|
378
|
+
settingsPath: string;
|
|
379
|
+
displayName: string;
|
|
380
|
+
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
381
|
+
maxOutputTokens?: number;
|
|
382
|
+
};
|
|
383
|
+
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
384
|
+
customHeadersEnv?: string;
|
|
385
|
+
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
386
|
+
customHeadersFormat?: "newline" | "comma";
|
|
387
|
+
/**
|
|
388
|
+
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
389
|
+
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
390
|
+
* reads at request time. Alternative to customHeadersEnv for agents without a
|
|
391
|
+
* single custom-headers env var.
|
|
392
|
+
*/
|
|
393
|
+
spendTrackingEnvs?: {
|
|
394
|
+
/** Env var name for x-litellm-customer-id value */
|
|
395
|
+
sessionTagEnv: string;
|
|
396
|
+
/** Env var name for x-litellm-tags value */
|
|
397
|
+
runTagEnv: string;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Config-file-based spend tracking for CLIs that read custom headers from a
|
|
401
|
+
* JSON settings file (e.g., Qwen settings.json → model.generationConfig.customHeaders).
|
|
402
|
+
* The SDK writes headers to this file before each run.
|
|
403
|
+
* Source-verified: Qwen reads customHeaders from settings.json, not env vars.
|
|
404
|
+
*/
|
|
405
|
+
spendTrackingJsonConfig?: {
|
|
406
|
+
/** JSON path to the customHeaders object (dot-separated) */
|
|
407
|
+
headersPath: string;
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* TOML provider-based spend tracking for CLIs that read custom_headers from a
|
|
411
|
+
* provider entry in config.toml (e.g., Kimi Code).
|
|
412
|
+
* The SDK writes a provider+model entry with custom_headers before each run.
|
|
413
|
+
* Source-verified: Kimi Code reads custom_headers from
|
|
414
|
+
* providers[name].custom_headers in ~/.kimi-code/config.toml.
|
|
415
|
+
*/
|
|
416
|
+
spendTrackingTomlProvider?: {
|
|
417
|
+
/** Config file path (e.g., "~/.kimi-code/config.toml") */
|
|
418
|
+
configPath: string;
|
|
419
|
+
/** Provider name in config (e.g., "evolve-gateway") */
|
|
420
|
+
providerName: string;
|
|
421
|
+
/** Model entry name (e.g., "evolve-default") */
|
|
422
|
+
modelName: string;
|
|
423
|
+
/** Max context size for the model entry */
|
|
424
|
+
maxContextSize: number;
|
|
425
|
+
};
|
|
426
|
+
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
427
|
+
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
428
|
+
checkpointDirs?: string[];
|
|
429
|
+
/** Additional relative paths to exclude from checkpoint tar. */
|
|
430
|
+
checkpointExcludes?: string[];
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Registry of all supported agents.
|
|
434
|
+
*
|
|
435
|
+
* Each agent defines a buildCommand function that constructs the CLI command.
|
|
436
|
+
* This is type-safe and handles conditional logic cleanly.
|
|
437
|
+
*/
|
|
438
|
+
declare const AGENT_REGISTRY: Record<AgentType, AgentRegistryEntry>;
|
|
439
|
+
/**
|
|
440
|
+
* Get registry entry for an agent type
|
|
441
|
+
*/
|
|
442
|
+
declare function getAgentConfig(agentType: AgentType): AgentRegistryEntry;
|
|
443
|
+
/**
|
|
444
|
+
* Check if an agent type is valid
|
|
445
|
+
*/
|
|
446
|
+
declare function isValidAgentType(type: string): type is AgentType;
|
|
447
|
+
/**
|
|
448
|
+
* Expand path with ~ to /home/user
|
|
449
|
+
*/
|
|
450
|
+
declare function expandPath(path: string): string;
|
|
451
|
+
/**
|
|
452
|
+
* Get MCP settings path for an agent
|
|
453
|
+
*/
|
|
454
|
+
declare function getMcpSettingsPath(agentType: AgentType): string;
|
|
455
|
+
/**
|
|
456
|
+
* Get MCP settings directory for an agent
|
|
457
|
+
*/
|
|
458
|
+
declare function getMcpSettingsDir(agentType: AgentType): string;
|
|
459
|
+
|
|
460
|
+
interface ManagedSecretRef {
|
|
461
|
+
name: string;
|
|
462
|
+
as?: string;
|
|
463
|
+
}
|
|
464
|
+
interface ManagedSecretMetadata {
|
|
465
|
+
id: string;
|
|
466
|
+
name: string;
|
|
467
|
+
allowedHosts: string[];
|
|
468
|
+
allowedPathPrefixes: string[];
|
|
469
|
+
allowedMethods: string[];
|
|
470
|
+
createdAt: string;
|
|
471
|
+
updatedAt: string;
|
|
472
|
+
lastUsedAt: string | null;
|
|
473
|
+
}
|
|
474
|
+
interface ManagedSecretsClientConfig {
|
|
475
|
+
apiKey?: string;
|
|
476
|
+
dashboardUrl?: string;
|
|
477
|
+
}
|
|
478
|
+
interface ManagedSecretsClient {
|
|
479
|
+
list(): Promise<ManagedSecretMetadata[]>;
|
|
480
|
+
}
|
|
481
|
+
declare function managedSecrets(config?: ManagedSecretsClientConfig): ManagedSecretsClient;
|
|
482
|
+
|
|
288
483
|
/** Result of a completed sandbox command */
|
|
289
484
|
interface SandboxCommandResult {
|
|
290
485
|
exitCode: number;
|
|
@@ -555,6 +750,12 @@ interface AgentOptions {
|
|
|
555
750
|
sandboxProvider?: SandboxProvider;
|
|
556
751
|
/** Additional environment secrets */
|
|
557
752
|
secrets?: Record<string, string>;
|
|
753
|
+
/** Dashboard-stored managed secrets exposed through opaque env vars. */
|
|
754
|
+
managedSecrets?: {
|
|
755
|
+
secrets: ManagedSecretRef[];
|
|
756
|
+
apiKey: string;
|
|
757
|
+
dashboardUrl?: string;
|
|
758
|
+
};
|
|
558
759
|
/** Existing sandbox ID to connect to */
|
|
559
760
|
sandboxId?: string;
|
|
560
761
|
/** Working directory path */
|
|
@@ -1020,6 +1221,8 @@ declare class Agent {
|
|
|
1020
1221
|
private droidSessionId?;
|
|
1021
1222
|
private managedBrowserSession?;
|
|
1022
1223
|
private providerRuntimeToken?;
|
|
1224
|
+
private managedSecretRuntimeToken?;
|
|
1225
|
+
private managedSecretProxy?;
|
|
1023
1226
|
private readonly skills?;
|
|
1024
1227
|
private readonly storage?;
|
|
1025
1228
|
private lastCheckpointId?;
|
|
@@ -1054,6 +1257,10 @@ declare class Agent {
|
|
|
1054
1257
|
private setupManagedBrowser;
|
|
1055
1258
|
private closeManagedBrowserSession;
|
|
1056
1259
|
private closeProviderRuntimeToken;
|
|
1260
|
+
private ensureManagedSecretRuntimeToken;
|
|
1261
|
+
private bindManagedSecretRuntimeToken;
|
|
1262
|
+
private setupManagedSecretEgress;
|
|
1263
|
+
private closeManagedSecretRuntimeToken;
|
|
1057
1264
|
/**
|
|
1058
1265
|
* Build the inline gateway config JSON for agents using gatewayConfigEnv
|
|
1059
1266
|
* (e.g., OpenCode OPENCODE_CONFIG_CONTENT). Centralizes the provider config
|
|
@@ -1067,9 +1274,12 @@ declare class Agent {
|
|
|
1067
1274
|
*/
|
|
1068
1275
|
private buildGatewayConfigJson;
|
|
1069
1276
|
private activeProviderRuntimeToken;
|
|
1277
|
+
private requireActiveProviderRuntimeToken;
|
|
1070
1278
|
private ensureSessionLogger;
|
|
1071
1279
|
private flushSessionLoggerWithTimeout;
|
|
1280
|
+
private requiresPreRunDashboardIngest;
|
|
1072
1281
|
private providerRuntimeHeaderUpdates;
|
|
1282
|
+
private shouldExposeProviderRuntimeTokenEnv;
|
|
1073
1283
|
private buildProviderRuntimeProcessEnvs;
|
|
1074
1284
|
/**
|
|
1075
1285
|
* Build per-run env overrides for spend tracking.
|
|
@@ -1090,6 +1300,7 @@ declare class Agent {
|
|
|
1090
1300
|
* Agent-specific authentication setup
|
|
1091
1301
|
*/
|
|
1092
1302
|
private setupAgentAuth;
|
|
1303
|
+
private writeGeminiGatewayAuthSettings;
|
|
1093
1304
|
private setupAgentPlugins;
|
|
1094
1305
|
private assertProviderRuntimeDoesNotExposeGatewayKey;
|
|
1095
1306
|
/**
|
|
@@ -1510,6 +1721,7 @@ interface EvolveConfig {
|
|
|
1510
1721
|
workingDirectory?: string;
|
|
1511
1722
|
workspaceMode?: WorkspaceMode;
|
|
1512
1723
|
secrets?: Record<string, string>;
|
|
1724
|
+
managedSecrets?: ManagedSecretRef[];
|
|
1513
1725
|
sandboxId?: string;
|
|
1514
1726
|
systemPrompt?: string;
|
|
1515
1727
|
context?: FileMap;
|
|
@@ -1582,6 +1794,12 @@ declare class Evolve extends EventEmitter {
|
|
|
1582
1794
|
* Add environment secrets
|
|
1583
1795
|
*/
|
|
1584
1796
|
withSecrets(secrets: Record<string, string>): this;
|
|
1797
|
+
/**
|
|
1798
|
+
* Attach Dashboard-stored managed secrets to the sandbox.
|
|
1799
|
+
*
|
|
1800
|
+
* The sandbox receives opaque env var values; raw secret values stay server-side.
|
|
1801
|
+
*/
|
|
1802
|
+
withManagedSecrets(secrets: ManagedSecretRef[]): this;
|
|
1585
1803
|
/**
|
|
1586
1804
|
* Connect to existing session
|
|
1587
1805
|
*/
|
|
@@ -1710,6 +1928,8 @@ declare class Evolve extends EventEmitter {
|
|
|
1710
1928
|
static browserCredentials: typeof browserCredentials;
|
|
1711
1929
|
/** Static browser profile client for listing and deleting reusable browser profiles. */
|
|
1712
1930
|
static browserProfiles: typeof browserProfiles;
|
|
1931
|
+
/** Static managed secrets client for listing Dashboard-stored secret metadata. */
|
|
1932
|
+
static managedSecrets: typeof managedSecrets;
|
|
1713
1933
|
/**
|
|
1714
1934
|
* Initialize agent on first use
|
|
1715
1935
|
*/
|
|
@@ -2684,178 +2904,6 @@ declare class TerminalPipeline<T> extends Pipeline<T> {
|
|
|
2684
2904
|
reduce(): never;
|
|
2685
2905
|
}
|
|
2686
2906
|
|
|
2687
|
-
/**
|
|
2688
|
-
* Agent Registry
|
|
2689
|
-
*
|
|
2690
|
-
* Single source of truth for agent-specific behavior.
|
|
2691
|
-
* All differences between agents are data, not code.
|
|
2692
|
-
*
|
|
2693
|
-
* Evidence: sdk-rewrite-v3.md Agent Registry section
|
|
2694
|
-
*/
|
|
2695
|
-
|
|
2696
|
-
/** Model configuration */
|
|
2697
|
-
interface ModelInfo {
|
|
2698
|
-
/** Model alias (short name used with --model) */
|
|
2699
|
-
alias: string;
|
|
2700
|
-
/** Full model ID */
|
|
2701
|
-
modelId: string;
|
|
2702
|
-
/** What this model is best for */
|
|
2703
|
-
description: string;
|
|
2704
|
-
}
|
|
2705
|
-
/** MCP configuration for an agent */
|
|
2706
|
-
interface McpConfigInfo {
|
|
2707
|
-
/** Settings directory (e.g., "~/.claude") */
|
|
2708
|
-
settingsDir: string;
|
|
2709
|
-
/** Config filename (e.g., "settings.json" or "config.toml") */
|
|
2710
|
-
filename: string;
|
|
2711
|
-
/** Config format */
|
|
2712
|
-
format: "json" | "toml";
|
|
2713
|
-
/** Whether to use workingDir for project-level config (Claude only) */
|
|
2714
|
-
projectConfig?: boolean;
|
|
2715
|
-
}
|
|
2716
|
-
/** Options for building agent commands */
|
|
2717
|
-
interface BuildCommandOptions {
|
|
2718
|
-
prompt: string;
|
|
2719
|
-
model: string;
|
|
2720
|
-
isResume: boolean;
|
|
2721
|
-
sessionId?: string;
|
|
2722
|
-
reasoningEffort?: string;
|
|
2723
|
-
isDirectMode?: boolean;
|
|
2724
|
-
/** Skills enabled for this run */
|
|
2725
|
-
skills?: string[];
|
|
2726
|
-
}
|
|
2727
|
-
interface AgentRegistryEntry {
|
|
2728
|
-
/** Sandbox image/template identifier (provider maps to its own concept) */
|
|
2729
|
-
image: string;
|
|
2730
|
-
/** Environment variable name for API key */
|
|
2731
|
-
apiKeyEnv: string;
|
|
2732
|
-
/** Environment variable name for OAuth (file path or token depending on agent) */
|
|
2733
|
-
oauthEnv?: string;
|
|
2734
|
-
/** OAuth credentials filename (e.g., "auth.json" for Codex, "oauth_creds.json" for Gemini) */
|
|
2735
|
-
oauthFileName?: string;
|
|
2736
|
-
/** Environment variable to set when OAuth is active (e.g., GOOGLE_GENAI_USE_GCA=true for Gemini) */
|
|
2737
|
-
oauthActivationEnv?: {
|
|
2738
|
-
key: string;
|
|
2739
|
-
value: string;
|
|
2740
|
-
};
|
|
2741
|
-
/** Environment variable name for base URL, if this CLI supports one */
|
|
2742
|
-
baseUrlEnv?: string;
|
|
2743
|
-
/** Default model alias */
|
|
2744
|
-
defaultModel: string;
|
|
2745
|
-
/** Available models for this agent */
|
|
2746
|
-
models: ModelInfo[];
|
|
2747
|
-
/** System prompt filename (e.g., "CLAUDE.md") */
|
|
2748
|
-
systemPromptFile: string;
|
|
2749
|
-
/** MCP configuration */
|
|
2750
|
-
mcpConfig: McpConfigInfo;
|
|
2751
|
-
/** Build the CLI command for this agent */
|
|
2752
|
-
buildCommand: (opts: BuildCommandOptions) => string;
|
|
2753
|
-
/** Extra setup step (e.g., codex login) */
|
|
2754
|
-
setupCommand?: string;
|
|
2755
|
-
/** Gateway path prefix for CLIs that use a provider-native passthrough endpoint */
|
|
2756
|
-
gatewayPath?: string;
|
|
2757
|
-
/** Default base URL for direct mode (only needed if provider requires specific endpoint, e.g., Qwen → Dashscope) */
|
|
2758
|
-
defaultBaseUrl?: string;
|
|
2759
|
-
/** Available beta headers for this agent (for reference) */
|
|
2760
|
-
availableBetas?: Record<string, string>;
|
|
2761
|
-
/** Skills configuration for this agent */
|
|
2762
|
-
skillsConfig: SkillsConfig;
|
|
2763
|
-
/** Multi-provider env mapping: model prefix → keyEnv (for CLIs like OpenCode that resolve provider from model string) */
|
|
2764
|
-
providerEnvMap?: Record<string, {
|
|
2765
|
-
keyEnv: string;
|
|
2766
|
-
}>;
|
|
2767
|
-
/** Env var for inline config (e.g., OPENCODE_CONFIG_CONTENT) — used in gateway mode to set provider base URLs */
|
|
2768
|
-
gatewayConfigEnv?: string;
|
|
2769
|
-
/** Gateway-only model aliases for CLIs whose native model IDs differ from LiteLLM route names */
|
|
2770
|
-
gatewayModelAliases?: Record<string, string>;
|
|
2771
|
-
/** Direct-mode model aliases for CLIs whose public model names differ from CLI-native model IDs */
|
|
2772
|
-
directModelAliases?: Record<string, string>;
|
|
2773
|
-
/** Do not set provider API key env in gateway mode (used when routing via generated settings instead) */
|
|
2774
|
-
skipApiKeyEnvInGateway?: boolean;
|
|
2775
|
-
/** Dedicated Droid settings file for Evolve gateway custom model routing */
|
|
2776
|
-
droidGatewaySettings?: {
|
|
2777
|
-
settingsPath: string;
|
|
2778
|
-
displayName: string;
|
|
2779
|
-
provider: "generic-chat-completion-api" | "openai" | "anthropic";
|
|
2780
|
-
maxOutputTokens?: number;
|
|
2781
|
-
};
|
|
2782
|
-
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2783
|
-
customHeadersEnv?: string;
|
|
2784
|
-
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
2785
|
-
customHeadersFormat?: "newline" | "comma";
|
|
2786
|
-
/**
|
|
2787
|
-
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
2788
|
-
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
2789
|
-
* reads at request time. Alternative to customHeadersEnv for agents without a
|
|
2790
|
-
* single custom-headers env var.
|
|
2791
|
-
*/
|
|
2792
|
-
spendTrackingEnvs?: {
|
|
2793
|
-
/** Env var name for x-litellm-customer-id value */
|
|
2794
|
-
sessionTagEnv: string;
|
|
2795
|
-
/** Env var name for x-litellm-tags value */
|
|
2796
|
-
runTagEnv: string;
|
|
2797
|
-
};
|
|
2798
|
-
/**
|
|
2799
|
-
* Config-file-based spend tracking for CLIs that read custom headers from a
|
|
2800
|
-
* JSON settings file (e.g., Qwen settings.json → model.generationConfig.customHeaders).
|
|
2801
|
-
* The SDK writes headers to this file before each run.
|
|
2802
|
-
* Source-verified: Qwen reads customHeaders from settings.json, not env vars.
|
|
2803
|
-
*/
|
|
2804
|
-
spendTrackingJsonConfig?: {
|
|
2805
|
-
/** JSON path to the customHeaders object (dot-separated) */
|
|
2806
|
-
headersPath: string;
|
|
2807
|
-
};
|
|
2808
|
-
/**
|
|
2809
|
-
* TOML provider-based spend tracking for CLIs that read custom_headers from a
|
|
2810
|
-
* provider entry in config.toml (e.g., Kimi Code).
|
|
2811
|
-
* The SDK writes a provider+model entry with custom_headers before each run.
|
|
2812
|
-
* Source-verified: Kimi Code reads custom_headers from
|
|
2813
|
-
* providers[name].custom_headers in ~/.kimi-code/config.toml.
|
|
2814
|
-
*/
|
|
2815
|
-
spendTrackingTomlProvider?: {
|
|
2816
|
-
/** Config file path (e.g., "~/.kimi-code/config.toml") */
|
|
2817
|
-
configPath: string;
|
|
2818
|
-
/** Provider name in config (e.g., "evolve-gateway") */
|
|
2819
|
-
providerName: string;
|
|
2820
|
-
/** Model entry name (e.g., "evolve-default") */
|
|
2821
|
-
modelName: string;
|
|
2822
|
-
/** Max context size for the model entry */
|
|
2823
|
-
maxContextSize: number;
|
|
2824
|
-
};
|
|
2825
|
-
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
2826
|
-
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
2827
|
-
checkpointDirs?: string[];
|
|
2828
|
-
/** Additional relative paths to exclude from checkpoint tar. */
|
|
2829
|
-
checkpointExcludes?: string[];
|
|
2830
|
-
}
|
|
2831
|
-
/**
|
|
2832
|
-
* Registry of all supported agents.
|
|
2833
|
-
*
|
|
2834
|
-
* Each agent defines a buildCommand function that constructs the CLI command.
|
|
2835
|
-
* This is type-safe and handles conditional logic cleanly.
|
|
2836
|
-
*/
|
|
2837
|
-
declare const AGENT_REGISTRY: Record<AgentType, AgentRegistryEntry>;
|
|
2838
|
-
/**
|
|
2839
|
-
* Get registry entry for an agent type
|
|
2840
|
-
*/
|
|
2841
|
-
declare function getAgentConfig(agentType: AgentType): AgentRegistryEntry;
|
|
2842
|
-
/**
|
|
2843
|
-
* Check if an agent type is valid
|
|
2844
|
-
*/
|
|
2845
|
-
declare function isValidAgentType(type: string): type is AgentType;
|
|
2846
|
-
/**
|
|
2847
|
-
* Expand path with ~ to /home/user
|
|
2848
|
-
*/
|
|
2849
|
-
declare function expandPath(path: string): string;
|
|
2850
|
-
/**
|
|
2851
|
-
* Get MCP settings path for an agent
|
|
2852
|
-
*/
|
|
2853
|
-
declare function getMcpSettingsPath(agentType: AgentType): string;
|
|
2854
|
-
/**
|
|
2855
|
-
* Get MCP settings directory for an agent
|
|
2856
|
-
*/
|
|
2857
|
-
declare function getMcpSettingsDir(agentType: AgentType): string;
|
|
2858
|
-
|
|
2859
2907
|
/**
|
|
2860
2908
|
* MCP JSON Configuration Writer
|
|
2861
2909
|
*
|
|
@@ -3206,4 +3254,4 @@ interface SessionsClient {
|
|
|
3206
3254
|
*/
|
|
3207
3255
|
declare function sessions(config?: SessionsConfig): SessionsClient;
|
|
3208
3256
|
|
|
3209
|
-
export { AGENT_REGISTRY, AGENT_TYPES, type ActionbookBrowserConfig, Agent, type AgentBrowserConfig, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentPluginConfig, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, BROWSER_ACTIONBOOK_PROMPT, BROWSER_LOGIN_MCP_SERVER_NAME, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type BrowserConfig, type BrowserCredentialCreateInput, type BrowserCredentialDeleteInput, type BrowserCredentialListOptions, type BrowserCredentialMetadata, type BrowserCredentialScopeEntry, BrowserCredentialsClient, type BrowserCredentialsClientConfig, type BrowserCredentialsConfig, type BrowserProfileDeleteInput, type BrowserProfileMetadata, BrowserProfilesClient, type BrowserProfilesClientConfig, type BrowserProvider, type BrowserReplay, type BrowserReplayOptions, type BrowserRuntimeInfo, type CandidateCompleteEvent, type CheckpointInfo, type CodexAgentPluginConfig, type DefaultBrowserConfig, 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 IntegrationAccount, type IntegrationAccountDeleteParams, type IntegrationAccountDeleteResult, type IntegrationAccountListParams, type IntegrationAccountUpdateParams, type IntegrationAccountUpdateResult, type IntegrationAuthParams, type IntegrationAuthResult, type IntegrationToolsFilter, type IntegrationsConfig, type IntegrationsSetup, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type ListSessionsOptions, type ManagedBrowserProvider, 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, 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, browserCredentials, browserProfiles, 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 };
|
|
3257
|
+
export { AGENT_REGISTRY, AGENT_TYPES, type ActionbookBrowserConfig, Agent, type AgentBrowserConfig, type AgentConfig, type AgentOptions, type AgentOverride, type AgentParser, type AgentPluginConfig, type AgentRegistryEntry, type AgentResponse, type AgentRuntimeState, type AgentType, BROWSER_ACTIONBOOK_PROMPT, BROWSER_LOGIN_MCP_SERVER_NAME, type BaseMeta, type BestOfConfig, type BestOfParams, type BestOfResult, type BrowserConfig, type BrowserCredentialCreateInput, type BrowserCredentialDeleteInput, type BrowserCredentialListOptions, type BrowserCredentialMetadata, type BrowserCredentialScopeEntry, BrowserCredentialsClient, type BrowserCredentialsClientConfig, type BrowserCredentialsConfig, type BrowserProfileDeleteInput, type BrowserProfileMetadata, BrowserProfilesClient, type BrowserProfilesClientConfig, type BrowserProvider, type BrowserReplay, type BrowserReplayOptions, type BrowserRuntimeInfo, type CandidateCompleteEvent, type CheckpointInfo, type CodexAgentPluginConfig, type DefaultBrowserConfig, 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 IntegrationAccount, type IntegrationAccountDeleteParams, type IntegrationAccountDeleteResult, type IntegrationAccountListParams, type IntegrationAccountUpdateParams, type IntegrationAccountUpdateResult, type IntegrationAuthParams, type IntegrationAuthResult, type IntegrationToolsFilter, type IntegrationsConfig, type IntegrationsSetup, type ItemInput, type ItemRetryEvent, JUDGE_PROMPT, type JsonSchema, type JudgeCompleteEvent, type JudgeDecision, type JudgeMeta, type LifecycleEvent, type LifecycleReason, type ListSessionsOptions, type ManagedBrowserProvider, type ManagedSecretMetadata, type ManagedSecretRef, type ManagedSecretsClient, type ManagedSecretsClientConfig, 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, 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, browserCredentials, browserProfiles, buildWorkerSystemPrompt, createAgentParser, createClaudeParser, createCodexParser, createDroidParser, createGeminiParser, executeWithRetry, expandPath, getAgentConfig, getMcpSettingsDir, getMcpSettingsPath, isValidAgentType, isZodSchema, jsonSchemaToString, managedSecrets, parseNdjsonLine, parseNdjsonOutput, parseQwenOutput, readLocalDir, resolveStorageConfig, saveLocalDir, sessions, storage, writeClaudeMcpConfig, writeCodexMcpConfig, writeDroidGatewaySettings, writeDroidMcpConfig, writeGeminiMcpConfig, writeMcpConfig, writeQwenMcpConfig, zodSchemaToJson };
|