import type { ConfigGetOptions, ConfigLayer, ConfigSetOptions, ConfigV2, MiniMaxProviderConfig, OcrAuthHeader, OcrConfig, OcrLlmConfig, PeaksConfig, TokenRef, WorkspaceConfig } from './config-types.js'; export { resolveProjectRootForConfig, resolveCanonicalProjectRoot } from './config-safety.js'; /** * Load the slim 2.0 `~/.peaks/config.json` file. Returns the parsed * object when the file is at schema 2.0.0; returns null when the * file is absent (fresh install, no global config yet). * * Throws `CONFIG_LEGACY_VERSION` when the file exists at a 1.x * schema version — the caller is expected to run * `peaks config migrate --apply` to bring it forward before * continuing. This gate is intentional: a slim 2.0 reader must * not silently pass through a 1.x shape, because every field it * ignores is a field the caller is going to look for elsewhere * (preferences.json, .bak, _state/). */ export declare function loadGlobalConfig(): ConfigV2 | null; export declare function isConfigLayer(value: string): value is ConfigLayer; export declare function isSensitiveConfigPath(path: string): boolean; export declare function isLegacyConfigKey(path: string): boolean; export declare function containsSensitiveConfigValue(value: unknown): boolean; export type RedactedConfigValue = string | number | boolean | null | RedactedConfigValue[] | { [key: string]: RedactedConfigValue; }; export declare function redactConfigSecrets(value: unknown, path?: string): RedactedConfigValue; export type MiniMaxProviderStatus = { provider: 'minimax'; configured: boolean; baseUrlConfigured: boolean; apiKeyConfigured: boolean; storage: 'user-plaintext-v1'; nextActions: string[]; }; export declare function getMiniMaxProviderConfig(): MiniMaxProviderConfig; export declare function getMiniMaxProviderStatus(): MiniMaxProviderStatus; export declare function setMiniMaxProviderConfig(input: MiniMaxProviderConfig): MiniMaxProviderStatus; /** * Read the ocr LLM endpoint config from the user-layer * `~/.peaks/config.json`. The user populates this themselves by * pasting the `peaks code-review config-template` output (or by * running `peaks config set --key ocr.llm.url --value '...'`). * peaks-cli never auto-writes these values. */ export declare function getOcrConfig(): OcrConfig; /** * Return the resolved `OcrLlmConfig` block (`peaksConfig.ocr.llm`) * or `null` when the user has not populated the user config. The * 5-state OCR detector uses this as the source of truth; when the * returned block is missing required fields it produces a * `config-missing` state with a templated `nextActions` payload * the user can paste into their config. */ export declare function getOcrLlmConfig(): OcrLlmConfig | null; export declare function bootstrapProjectLanguageConfig(projectRoot: string, language: string): void; export declare function readConfig(projectRoot?: string | null): PeaksConfig; export declare function writeConfig(partial: Partial, layer?: ConfigLayer): void; export declare function getConfig(options?: ConfigGetOptions): unknown; export declare function setConfig(options: ConfigSetOptions): void; export declare function getWorkspaceConfig(workspaceId: string, _projectRoot?: string | null): WorkspaceConfig | null; export declare function addWorkspace(workspace: WorkspaceConfig, layer?: ConfigLayer): void; export declare function removeWorkspace(workspaceId: string, layer?: ConfigLayer): boolean; export declare function setCurrentWorkspace(workspaceId: string, layer?: ConfigLayer): boolean; export declare function getCurrentWorkspaceConfig(): WorkspaceConfig | null; export declare function getWorkspaceConfigForPath(path?: string): WorkspaceConfig | null; export declare function ensureWorkspaceConfigForPath(path?: string): WorkspaceConfig | null; export declare function getWorkspaceConfigForCurrentPath(): WorkspaceConfig | null; export declare function ensureWorkspaceConfigForCurrentPath(): WorkspaceConfig | null; export type { OcrAuthHeader, OcrConfig, OcrLlmConfig, TokenRef, WorkspaceConfig, PeaksConfig, ConfigLayer }; export { getUserConfigPath } from './config-safety.js'; export { globalConfigPath } from './config-migration.js';