@evolvingmachines/sdk 0.0.49 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -589,6 +589,11 @@ interface AgentOptions {
589
589
  apiKey: string;
590
590
  dashboardUrl?: string;
591
591
  };
592
+ /** Evolve-managed provider routing tokens for dashboard-stored BYOK provider keys. */
593
+ providerRouting?: {
594
+ apiKey: string;
595
+ dashboardUrl?: string;
596
+ };
592
597
  /** Plugins/extensions to install in the sandbox user profile before first run */
593
598
  plugins?: AgentPluginConfig[];
594
599
  /** Skills to enable (e.g., ["pdf", "dev-browser"]) */
@@ -1014,6 +1019,7 @@ declare class Agent {
1014
1019
  private agentState;
1015
1020
  private droidSessionId?;
1016
1021
  private managedBrowserSession?;
1022
+ private providerRuntimeToken?;
1017
1023
  private readonly skills?;
1018
1024
  private readonly storage?;
1019
1025
  private lastCheckpointId?;
@@ -1041,9 +1047,13 @@ declare class Agent {
1041
1047
  * Build environment variables for sandbox
1042
1048
  */
1043
1049
  private buildEnvironmentVariables;
1050
+ private validatedUserSecretsForEnvironment;
1044
1051
  private ensureManagedBrowserSession;
1052
+ private ensureProviderRuntimeToken;
1053
+ private bindProviderRuntimeToken;
1045
1054
  private setupManagedBrowser;
1046
1055
  private closeManagedBrowserSession;
1056
+ private closeProviderRuntimeToken;
1047
1057
  /**
1048
1058
  * Build the inline gateway config JSON for agents using gatewayConfigEnv
1049
1059
  * (e.g., OpenCode OPENCODE_CONFIG_CONTENT). Centralizes the provider config
@@ -1056,6 +1066,11 @@ declare class Agent {
1056
1066
  * Source-verified: model.headers → provider.ts:1061 → llm.ts:221 → HTTP request.
1057
1067
  */
1058
1068
  private buildGatewayConfigJson;
1069
+ private activeProviderRuntimeToken;
1070
+ private ensureSessionLogger;
1071
+ private flushSessionLoggerWithTimeout;
1072
+ private providerRuntimeHeaderUpdates;
1073
+ private buildProviderRuntimeProcessEnvs;
1059
1074
  /**
1060
1075
  * Build per-run env overrides for spend tracking.
1061
1076
  * Merges session + run headers into the custom headers env var,
@@ -1063,6 +1078,7 @@ declare class Agent {
1063
1078
  * Passed to spawn() so each .run() gets a unique run tag.
1064
1079
  */
1065
1080
  private buildRunEnvs;
1081
+ private writeCodexGatewayProviderConfig;
1066
1082
  private captureDroidSession;
1067
1083
  private extractDroidSessionId;
1068
1084
  private findDroidSessionId;
@@ -1075,6 +1091,7 @@ declare class Agent {
1075
1091
  */
1076
1092
  private setupAgentAuth;
1077
1093
  private setupAgentPlugins;
1094
+ private assertProviderRuntimeDoesNotExposeGatewayKey;
1078
1095
  /**
1079
1096
  * Setup workspace structure and files
1080
1097
  *
@@ -2790,13 +2807,13 @@ interface AgentRegistryEntry {
2790
2807
  };
2791
2808
  /**
2792
2809
  * TOML provider-based spend tracking for CLIs that read custom_headers from a
2793
- * provider entry in config.toml (e.g., Kimi).
2810
+ * provider entry in config.toml (e.g., Kimi Code).
2794
2811
  * The SDK writes a provider+model entry with custom_headers before each run.
2795
- * Source-verified: Kimi reads custom_headers from providers[name].custom_headers
2796
- * in ~/.kimi/config.toml (config.py:45, llm.py:101).
2812
+ * Source-verified: Kimi Code reads custom_headers from
2813
+ * providers[name].custom_headers in ~/.kimi-code/config.toml.
2797
2814
  */
2798
2815
  spendTrackingTomlProvider?: {
2799
- /** Config file path (e.g., "~/.kimi/config.toml") */
2816
+ /** Config file path (e.g., "~/.kimi-code/config.toml") */
2800
2817
  configPath: string;
2801
2818
  /** Provider name in config (e.g., "evolve-gateway") */
2802
2819
  providerName: string;
@@ -2808,6 +2825,8 @@ interface AgentRegistryEntry {
2808
2825
  /** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
2809
2826
  * Used for agents like OpenCode that spread state across XDG directories. */
2810
2827
  checkpointDirs?: string[];
2828
+ /** Additional relative paths to exclude from checkpoint tar. */
2829
+ checkpointExcludes?: string[];
2811
2830
  }
2812
2831
  /**
2813
2832
  * Registry of all supported agents.
@@ -2847,7 +2866,7 @@ declare function getMcpSettingsDir(agentType: AgentType): string;
2847
2866
  * - Claude: { type: "http"|"sse"|"stdio", url: "..." }
2848
2867
  * - Gemini: { url: "...", type: "http"|"sse" } | { command: "..." }
2849
2868
  * - Qwen: { httpUrl: "..." } | { url: "..." } | { command: "..." }
2850
- * - Kimi: { url: "...", transport?: "http"|"sse" } | { command: "...", transport: "stdio" }
2869
+ * - Kimi Code: { url: "...", transport?: "http"|"sse" } | { command: "...", transport: "stdio" }
2851
2870
  */
2852
2871
 
2853
2872
  /**
package/dist/index.d.ts CHANGED
@@ -589,6 +589,11 @@ interface AgentOptions {
589
589
  apiKey: string;
590
590
  dashboardUrl?: string;
591
591
  };
592
+ /** Evolve-managed provider routing tokens for dashboard-stored BYOK provider keys. */
593
+ providerRouting?: {
594
+ apiKey: string;
595
+ dashboardUrl?: string;
596
+ };
592
597
  /** Plugins/extensions to install in the sandbox user profile before first run */
593
598
  plugins?: AgentPluginConfig[];
594
599
  /** Skills to enable (e.g., ["pdf", "dev-browser"]) */
@@ -1014,6 +1019,7 @@ declare class Agent {
1014
1019
  private agentState;
1015
1020
  private droidSessionId?;
1016
1021
  private managedBrowserSession?;
1022
+ private providerRuntimeToken?;
1017
1023
  private readonly skills?;
1018
1024
  private readonly storage?;
1019
1025
  private lastCheckpointId?;
@@ -1041,9 +1047,13 @@ declare class Agent {
1041
1047
  * Build environment variables for sandbox
1042
1048
  */
1043
1049
  private buildEnvironmentVariables;
1050
+ private validatedUserSecretsForEnvironment;
1044
1051
  private ensureManagedBrowserSession;
1052
+ private ensureProviderRuntimeToken;
1053
+ private bindProviderRuntimeToken;
1045
1054
  private setupManagedBrowser;
1046
1055
  private closeManagedBrowserSession;
1056
+ private closeProviderRuntimeToken;
1047
1057
  /**
1048
1058
  * Build the inline gateway config JSON for agents using gatewayConfigEnv
1049
1059
  * (e.g., OpenCode OPENCODE_CONFIG_CONTENT). Centralizes the provider config
@@ -1056,6 +1066,11 @@ declare class Agent {
1056
1066
  * Source-verified: model.headers → provider.ts:1061 → llm.ts:221 → HTTP request.
1057
1067
  */
1058
1068
  private buildGatewayConfigJson;
1069
+ private activeProviderRuntimeToken;
1070
+ private ensureSessionLogger;
1071
+ private flushSessionLoggerWithTimeout;
1072
+ private providerRuntimeHeaderUpdates;
1073
+ private buildProviderRuntimeProcessEnvs;
1059
1074
  /**
1060
1075
  * Build per-run env overrides for spend tracking.
1061
1076
  * Merges session + run headers into the custom headers env var,
@@ -1063,6 +1078,7 @@ declare class Agent {
1063
1078
  * Passed to spawn() so each .run() gets a unique run tag.
1064
1079
  */
1065
1080
  private buildRunEnvs;
1081
+ private writeCodexGatewayProviderConfig;
1066
1082
  private captureDroidSession;
1067
1083
  private extractDroidSessionId;
1068
1084
  private findDroidSessionId;
@@ -1075,6 +1091,7 @@ declare class Agent {
1075
1091
  */
1076
1092
  private setupAgentAuth;
1077
1093
  private setupAgentPlugins;
1094
+ private assertProviderRuntimeDoesNotExposeGatewayKey;
1078
1095
  /**
1079
1096
  * Setup workspace structure and files
1080
1097
  *
@@ -2790,13 +2807,13 @@ interface AgentRegistryEntry {
2790
2807
  };
2791
2808
  /**
2792
2809
  * TOML provider-based spend tracking for CLIs that read custom_headers from a
2793
- * provider entry in config.toml (e.g., Kimi).
2810
+ * provider entry in config.toml (e.g., Kimi Code).
2794
2811
  * The SDK writes a provider+model entry with custom_headers before each run.
2795
- * Source-verified: Kimi reads custom_headers from providers[name].custom_headers
2796
- * in ~/.kimi/config.toml (config.py:45, llm.py:101).
2812
+ * Source-verified: Kimi Code reads custom_headers from
2813
+ * providers[name].custom_headers in ~/.kimi-code/config.toml.
2797
2814
  */
2798
2815
  spendTrackingTomlProvider?: {
2799
- /** Config file path (e.g., "~/.kimi/config.toml") */
2816
+ /** Config file path (e.g., "~/.kimi-code/config.toml") */
2800
2817
  configPath: string;
2801
2818
  /** Provider name in config (e.g., "evolve-gateway") */
2802
2819
  providerName: string;
@@ -2808,6 +2825,8 @@ interface AgentRegistryEntry {
2808
2825
  /** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
2809
2826
  * Used for agents like OpenCode that spread state across XDG directories. */
2810
2827
  checkpointDirs?: string[];
2828
+ /** Additional relative paths to exclude from checkpoint tar. */
2829
+ checkpointExcludes?: string[];
2811
2830
  }
2812
2831
  /**
2813
2832
  * Registry of all supported agents.
@@ -2847,7 +2866,7 @@ declare function getMcpSettingsDir(agentType: AgentType): string;
2847
2866
  * - Claude: { type: "http"|"sse"|"stdio", url: "..." }
2848
2867
  * - Gemini: { url: "...", type: "http"|"sse" } | { command: "..." }
2849
2868
  * - Qwen: { httpUrl: "..." } | { url: "..." } | { command: "..." }
2850
- * - Kimi: { url: "...", transport?: "http"|"sse" } | { command: "...", transport: "stdio" }
2869
+ * - Kimi Code: { url: "...", transport?: "http"|"sse" } | { command: "...", transport: "stdio" }
2851
2870
  */
2852
2871
 
2853
2872
  /**