/** * Configuration loader for Genspark Tool CLI * * Loads configuration from multiple sources with the following priority (highest to lowest): * 1. Command-line options * 2. Environment variables (GSK_API_KEY, GSK_BASE_URL) * 3. Config file (~/.genspark-tool-cli/config.json) */ import type { ToolSchema } from './types.js'; export interface ConfigFile { api_key?: string; base_url?: string; timeout?: number; debug?: boolean; project_id?: string; auto_update?: boolean; /** * Virtual Developer project ID — gates the visibility of the `gsk vd` * subcommand group. When set (either here or via GSK_VD_PROJECT_ID env * var), the CLI exposes `gsk vd ` and auto-injects this value as * the default for every `--vd_project_id` flag. When unset, the whole * `vd` subcommand group is hidden from the CLI. */ vd_project_id?: string; } export declare const GSK_CLI_CAPS = "cli-groups-v2,cli-paths-v3,cli-actions-v4,cli-confirm-v1,cli-yes-only-v1,cli-local-source-v1"; /** * Set (or clear) the custom config path. Call this before any other * function in this module so that subsequent reads/writes target the * override. Pass `undefined` to reset to the default location. */ export declare function setConfigPathOverride(absPath: string | undefined): void; /** * Get the path to the config file — honours a `--config` override. */ export declare function getConfigPath(): string; /** * Keep one canonical spelling for endpoint persistence and cache keys. */ export declare function normalizeBaseUrl(baseUrl: string): string; /** * Load configuration from the config file * Returns an empty object if the file doesn't exist or is invalid */ export declare function loadConfigFile(): ConfigFile; /** * Replace the selected config file. * * Prefer `updateConfigFile` for login/logout-style field changes because this * replacement API intentionally cannot preserve fields absent from `config`. */ export declare function saveConfigFile(config: ConfigFile): void; /** * Patch known fields in the selected config without dropping extension fields. */ export declare function updateConfigFile(updates: Partial, removeKeys?: (keyof ConfigFile)[]): void; export declare function getCachedFeatures(): Record | undefined; /** * Load tools from the cache file. * Returns null if cache doesn't exist, is stale (>24h), or base_url doesn't match. */ export declare function loadToolsCache(baseUrl: string): ToolSchema[] | null; /** * Delete this binary's tools cache so the NEXT invocation refetches the * manifest. For refusal paths where the cached schema itself may be the * problem (the manifest is cached 24h and gatekeeper-tailored per user, so * a parameter the server just started accepting can be missing only from * the stale cache): busting here makes the user's rerun authoritative. * Only the caps-scoped file is touched — the legacy file belongs to * pre-caps binaries (see LEGACY_TOOLS_CACHE_FILE). */ export declare function clearToolsCache(): void; /** * Save tools (and the server-negotiated feature bits) to the cache file. */ export declare function saveToolsCache(baseUrl: string, tools: ToolSchema[], features?: Record): void; /** * The credential the CLI sends on its own HTTP requests. * * GenTeam sandboxes export a per-turn credential (`dtk-…`, minted by the * backend for the running turn — see * `backend/digital_employee/runtime/turn_credential.py`) as * `GSK_TURN_TOKEN` into each bash exec. It is preferred over the * per-agent `GSK_API_KEY` for gsk requests only: `GSK_API_KEY` itself is * untouched because sb-git clone URLs and other tooling still need the * plain key. Anything else in the variable is ignored (fail back to the * key), so a stray value can never break the CLI. */ export declare function resolveRequestCredential(apiKey: string | undefined, env?: NodeJS.ProcessEnv): string; //# sourceMappingURL=config.d.ts.map