/**
 * The session-log record of which preset a session actually runs.
 *
 * The creation header names the preset a session STARTED with, and it is
 * deep-frozen because that is a creation fact. A session may still change
 * preset while it is blank, and the effect of that change outlives the blank
 * window: the first turn — and every turn after it — runs under the newly
 * mounted composition. Recording the change is what keeps the log honest, and
 * it is required outright by the repo's model-visible ⟺ logged rule, since the
 * preset decides the tool schemas and prompt sections the model sees.
 *
 * Reconstruction reads the `agentPreset` Session projection, never the header
 * alone.
 * @module @deepseek-ai/dsh-agent-presets/session
 */
import { z } from 'zod';
const agentPresetSchema = z.union([z.string(), z.null()]);
/** Current Session preset, initialized from its header and advanced by selection events. */
export const agentPresetProjectionDefinition = {
    key: 'agentPreset',
    stateSchema: agentPresetSchema,
    init: header => header.agentPreset ?? null,
    apply: (state, event) => event.type === 'agent-preset/selected'
        ? event.data.agentPreset
        : state,
    wire: { viewSchema: agentPresetSchema, view: state => state },
    stateVersion: 1,
};
//# sourceMappingURL=session.js.map