import type { CustomSecret, SearchResult, TotemConfig } from '@mmnto/totem';
import { CONFIG_FILES } from '@mmnto/totem';
/** execFileSync on Windows can't resolve executables without `shell: true`. */
export declare const IS_WIN: boolean;
/** Timeout for GitHub CLI calls (ms). */
export declare const GH_TIMEOUT_MS = 15000;
/**
 * Load environment variables from .env file (does not override existing).
 * Uses the `dotenv` library for robust parsing of inline comments, quoted
 * values containing `#`, and other edge cases.
 */
export declare function loadEnv(cwd: string): void;
export { CONFIG_FILES };
export type ConfigFormat = 'ts' | 'yaml' | 'toml';
/** Return the global totem directory path (~/.totem/). Accepts override for testing. */
export declare function getGlobalTotemDir(homeDir?: string): string;
/**
 * Resolve config path by checking the fallback chain: .ts → .yaml → .yml → .toml
 * Falls back to the global ~/.totem/ profile when no local config exists.
 */
export declare function resolveConfigPath(cwd: string, homeDir?: string): string;
/** Check whether a resolved config path comes from the global ~/.totem/ profile. */
export declare function isGlobalConfigPath(configPath: string, homeDir?: string): boolean;
/**
 * Load and validate Totem configuration from any supported format.
 * Routes parsing by file extension: .ts via jiti, .yaml/.yml via yaml, .toml via smol-toml.
 */
export declare function loadConfig(configPath: string): Promise<TotemConfig>;
export { requireEmbedding } from '@mmnto/totem';
/**
 * Reap orphaned temp files older than `maxAgeMs` from `.totem/temp/`.
 * Fire-and-forget — never blocks the CLI critical path.
 */
export declare function reapOrphanedTempFiles(cwd: string, totemDir: string, maxAgeMs?: number): Promise<number>;
/**
 * Load a custom system prompt from `.totem/prompts/<commandName>.md` if it exists.
 * Falls back to the built-in default prompt when the file is missing, empty, or unreadable.
 */
export declare function getSystemPrompt(commandName: string, defaultPrompt: string, cwd: string, totemDir: string): string;
export declare function writeOutput(content: string, outPath?: string): void;
export { sanitize } from '@mmnto/totem';
export { wrapUntrustedXml, wrapXml } from '@mmnto/totem';
export declare function formatResults(results: SearchResult[], heading: string, condensed?: boolean): string;
/** Default character budget for lesson sections across orchestrator commands. */
export declare const DEFAULT_MAX_LESSON_CHARS = 8000;
/**
 * Partition search results into lessons (from lessons.md) and non-lesson specs.
 */
export declare function partitionLessons(allSpecs: SearchResult[], maxLessons: number, maxSpecs: number): {
    lessons: SearchResult[];
    specs: SearchResult[];
};
/**
 * Format lessons as a prompt section with character budgeting.
 * Use `condensed` for high-frequency commands (triage) to save tokens.
 * Returns empty string if no lessons fit within the budget.
 */
export declare function formatLessonSection(lessons: SearchResult[], maxChars?: number, condensed?: boolean): string;
export interface OrchestratorRunOptions {
    raw?: boolean;
    out?: string;
    model?: string;
    fresh?: boolean;
}
/**
 * Validate orchestrator config, then either output raw context (--raw) or
 * invoke the configured orchestrator provider and return the LLM content.
 *
 * Returns `undefined` in --raw mode (prompt already written to output).
 * Returns the LLM response content string otherwise.
 * Callers are responsible for writing output via `writeOutput()`.
 */
export declare function runOrchestrator(opts: {
    prompt: string;
    /**
     * Optional persistent system context that providers MAY cache server-side
     * (mmnto/totem#1291 Phase 3). When set AND the orchestrator config has
     * `enableContextCaching: true`, providers like Anthropic mark this segment
     * with `cache_control: { type: 'ephemeral' }` so subsequent calls within
     * the TTL window read from prompt cache at ~10% the input-token cost.
     */
    systemPrompt?: string;
    tag: string;
    options: OrchestratorRunOptions;
    config: TotemConfig;
    cwd: string;
    /** Absolute path to the directory containing totem.config.* — used for cache paths instead of cwd */
    configRoot?: string;
    totalResults?: number;
    temperature?: number;
    /** User-defined custom secrets to redact via DLP before outbound LLM calls (#921). */
    customSecrets?: CustomSecret[];
}): Promise<string | undefined>;
//# sourceMappingURL=utils.d.ts.map