@evolvingmachines/sdk 0.0.29 → 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 +59 -57
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +59 -57
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -966,6 +966,18 @@ declare class Agent {
|
|
|
966
966
|
* Build environment variables for sandbox
|
|
967
967
|
*/
|
|
968
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;
|
|
969
981
|
/**
|
|
970
982
|
* Build per-run env overrides for spend tracking.
|
|
971
983
|
* Merges session + run headers into the custom headers env var,
|
|
@@ -2566,6 +2578,8 @@ interface AgentRegistryEntry {
|
|
|
2566
2578
|
gatewayConfigEnv?: string;
|
|
2567
2579
|
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2568
2580
|
customHeadersEnv?: string;
|
|
2581
|
+
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
2582
|
+
customHeadersFormat?: "newline" | "comma";
|
|
2569
2583
|
/**
|
|
2570
2584
|
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
2571
2585
|
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
@@ -2578,6 +2592,33 @@ interface AgentRegistryEntry {
|
|
|
2578
2592
|
/** Env var name for x-litellm-tags value */
|
|
2579
2593
|
runTagEnv: string;
|
|
2580
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
|
+
};
|
|
2581
2622
|
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
2582
2623
|
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
2583
2624
|
checkpointDirs?: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -966,6 +966,18 @@ declare class Agent {
|
|
|
966
966
|
* Build environment variables for sandbox
|
|
967
967
|
*/
|
|
968
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;
|
|
969
981
|
/**
|
|
970
982
|
* Build per-run env overrides for spend tracking.
|
|
971
983
|
* Merges session + run headers into the custom headers env var,
|
|
@@ -2566,6 +2578,8 @@ interface AgentRegistryEntry {
|
|
|
2566
2578
|
gatewayConfigEnv?: string;
|
|
2567
2579
|
/** Environment variable that CLI reads for custom outbound HTTP headers */
|
|
2568
2580
|
customHeadersEnv?: string;
|
|
2581
|
+
/** Format for custom headers env var: "newline" (Claude) or "comma" (Gemini). Default: "newline" */
|
|
2582
|
+
customHeadersFormat?: "newline" | "comma";
|
|
2569
2583
|
/**
|
|
2570
2584
|
* Per-env-var spend tracking for CLIs that support env_http_headers in config
|
|
2571
2585
|
* (e.g., Codex TOML). Maps LiteLLM header names to env var names that the CLI
|
|
@@ -2578,6 +2592,33 @@ interface AgentRegistryEntry {
|
|
|
2578
2592
|
/** Env var name for x-litellm-tags value */
|
|
2579
2593
|
runTagEnv: string;
|
|
2580
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
|
+
};
|
|
2581
2622
|
/** Additional directories to include in checkpoint tar (beyond mcpConfig.settingsDir).
|
|
2582
2623
|
* Used for agents like OpenCode that spread state across XDG directories. */
|
|
2583
2624
|
checkpointDirs?: string[];
|