/**
 * SessionConfigService — owns the "write side" of per-session agent settings
 * (model override, thinking level, reasoning level, working directory).
 *
 * Previously these lived as four sibling methods on `AgentService`:
 *   - `patchSessionAgentConfig` (96 lines of validation + persistence)
 *   - `applyCronJobWorkingDirectory` (cron-specific working dir update)
 *   - `clearCronSessionWorkingDirectoryOverride` (private helper)
 *   - `clearSessionModelOverride` (private helper)
 *
 * Extracted so `AgentService` no longer mixes "session bag" concerns with
 * "session config write" concerns, and so future additions to the patch API
 * (e.g. new per-session overrides) only touch this file.
 */
import type { Config } from '../../config/schema.js';
import type { SessionConfigStore, SessionStore } from '../../session/index.js';
import type { AgentInstanceGateway } from '../agent-instance-gateway.js';
import type { ModelManager } from '../models/index.js';
export interface SessionConfigServiceOptions {
    sessionStore: SessionStore;
    sessionConfigStore: SessionConfigStore;
    modelManager: ModelManager;
    agentManager: AgentInstanceGateway;
    /** Effective config snapshot accessor. */
    getConfig: () => Config | undefined;
}
export interface PatchSessionAgentConfigInput {
    thinkingLevel?: string;
    model?: string | null;
    reasoningLevel?: string;
    workingDirectory?: string;
}
export interface PatchSessionAgentConfigResult {
    ok: boolean;
    error?: string;
}
export declare class SessionConfigService {
    private readonly opts;
    constructor(opts: SessionConfigServiceOptions);
    /**
     * Apply a partial patch (model / thinking / reasoning / working directory) to
     * a session's persisted config. Returns `{ ok: false, error }` on the first
     * invalid field — earlier fields that succeeded are NOT rolled back, matching
     * the previous behaviour.
     */
    patch(sessionKey: string, partial: PatchSessionAgentConfigInput): Promise<PatchSessionAgentConfigResult>;
    /**
     * Sync persisted session working directory for an isolated cron run. Runs
     * may change when the job is edited; an empty/missing input clears the
     * override so the session uses the effective agent default.
     */
    applyCronJobWorkingDirectory(sessionKey: string, workingDirectory: string | undefined): Promise<void>;
    /**
     * Clear the session's model override (back to agent default). Used both by
     * {@link patch} and by `AgentService.resetSessionModelToAgentDefault`.
     */
    clearModelOverride(sessionKey: string): Promise<void>;
    private clearCronWorkingDirectoryOverride;
    /**
     * Apply the workingDirectory branch of `patch`. Returns the next-step result
     * (`ok: true` to keep going, `ok: false, error` to short-circuit the patch).
     *
     * Working directory has the strictest semantics: once a session has any
     * messages, it cannot move to a different directory — only re-setting the
     * same path is idempotent.
     */
    private patchWorkingDirectory;
}
