import type { ProjectScanOptions } from './services/project-scanner.js';
import { type Locale } from './i18n/types.js';
import type { VoiceConfig } from './services/voice/types.js';
export interface WorkerConfig {
    maxLiveWorkers?: number;
    idleSuspendMs?: number;
}
export type RepoPickerMode = 'all' | 'repos';
export interface GlobalConfig {
    lang?: Locale;
    /** Machine-wide repo picker display mode. Missing / 'all' preserves legacy
     *  behavior (repos + linked worktrees). 'repos' lists only main worktrees in
     *  selection cards; explicit /repo /abs/path/to/worktree still works. */
    repoPickerMode?: RepoPickerMode;
    /** Machine-wide dashboard settings. These are intentionally global rather
     *  than per-bot: they govern the dashboard security boundary and the default
     *  terminal-opening behavior of cards emitted by all daemons on this host. */
    dashboard?: DashboardGlobalConfig;
    /** TTS engine + credentials for the voice-summary feature. See
     *  services/voice/types.ts. Presence (with usable creds) gates the
     *  "🔊 语音总结" button. */
    voice?: VoiceConfig;
    /** Machine-wide worker resource policy. Daemon falls back to an
     *  auto-derived live-worker budget when this block is absent. */
    worker?: WorkerConfig;
    /** Machine-wide auto-update / auto-restart schedule. Off unless explicitly
     *  enabled. Only the primary daemon (bot-0) acts on it — see core/maintenance.ts. */
    maintenance?: MaintenanceConfig;
    /** Optional HTTP(S) proxy for the daemon's own outbound downloads (e.g. the
     *  HD2D office assets). Node's global fetch ignores HTTP_PROXY/HTTPS_PROXY,
     *  so hosts behind a proxy must set this (or the env vars, which we read as a
     *  fallback). Form: `http://host:port` or `http://user:pass@host:port`. */
    httpProxy?: string;
}
export interface MaintenanceConfig {
    /** At `time` (once/day) run `npm install -g botmux@latest` to install the
     *  latest version — download/install only, never restarts on its own.
     *  npm-global installs only (disabled for local-dev). */
    autoUpdate?: MaintenanceTask;
    /** When enabled (and autoUpdate is on), restart right after a successful
     *  auto-update that installed a newer version, to apply it. No schedule of
     *  its own — reuses autoUpdate's time, fires only when there's a pending
     *  update. */
    autoRestart?: MaintenanceToggle;
}
export interface MaintenanceTask {
    enabled?: boolean;
    /** Local-time (Asia/Shanghai) "HH:MM", once per day. */
    time?: string;
}
export interface MaintenanceToggle {
    enabled?: boolean;
}
export interface DashboardGlobalConfig {
    /** When true, dashboard GET/HEAD pages and JSON APIs are public read-only;
     *  mutations still require the active dashboard token. */
    publicReadOnly?: boolean;
    /** When true, terminal buttons on Feishu cards use Feishu's sidebar web_url
     *  wrapper. Default false opens the terminal URL directly. */
    openTerminalInFeishu?: boolean;
}
/** True when `s` is a valid 24h "HH:MM" (leading zero optional on hours).
 *  Shared by the config reader and the dashboard PUT validator. */
export declare function isValidHhMm(s: string): boolean;
/** Validate a maintenance patch from the dashboard PUT. Type-strict on enabled
 *  (both keys) and on autoUpdate's time. autoRestart is a toggle — any `time`
 *  on it is ignored (it reuses autoUpdate's schedule). */
export declare function parseMaintenancePatch(body: unknown): {
    ok: true;
    patch: MaintenanceConfig;
} | {
    ok: false;
    error: string;
};
export declare function globalConfigPath(): string;
/** Typed view of the global config. Validates `lang` so a malformed file
 *  can't propagate a bad value into the i18n module. */
export declare function readGlobalConfig(): GlobalConfig;
/** Derive repo-picker scan options from the machine-wide `repoPickerMode`.
 *  'repos' hides linked worktrees from selection cards; anything else
 *  (default 'all') lists repos + their worktrees. Shared by every scan
 *  entry point (daemon spawn paths + `/repo`) so they stay consistent. */
export declare function repoPickerScanOptions(): ProjectScanOptions;
/** Merge a patch into the on-disk config, preserving unknown keys. Creates
 *  the file (and parent dir) on first write. Use `null` to explicitly delete
 *  a known key from the file. */
export declare function mergeGlobalConfig(patch: Partial<Record<keyof GlobalConfig, GlobalConfig[keyof GlobalConfig] | null>>): void;
/** Merge only the dashboard sub-config, preserving unknown keys inside that
 *  object so a newer client can safely share the same config file. */
export declare function mergeDashboardConfig(patch: DashboardGlobalConfig): DashboardGlobalConfig;
/** Merge only the maintenance sub-config, preserving unknown sibling keys.
 *  Shallow-merges at the task level (autoUpdate / autoRestart): callers send
 *  the full task object, so a present key replaces it wholesale. */
export declare function mergeMaintenanceConfig(patch: MaintenanceConfig): MaintenanceConfig;
/** Convenience: set the global UI locale (or clear it when `null`). */
export declare function setGlobalLocale(loc: Locale | null): void;
//# sourceMappingURL=global-config.d.ts.map