const EXECUTION_PRESETS = [
    {
        id: 'fast',
        name: 'Fast',
        summary: 'Lowest-cost path: light worker fan-out, deterministic backends, and standard verification.',
        orchestrationDepth: 'light',
        verification: 'standard',
        subagents: 'minimal',
        selection: {
            workers: 1,
            optimizationProfile: 'standard',
            backendMode: 'default',
            backendSelectors: {
                memoryBackend: 'sqlite-memory',
                compressionBackend: 'deterministic-token-supremacy',
                dslCompiler: 'deterministic-nxl-compiler',
            },
            reviewPolicy: { mode: 'runtime-only' },
            continuationPolicy: { mode: 'manual' },
        },
    },
    {
        id: 'balanced',
        name: 'Balanced',
        summary: 'Default Nexus posture: moderate worker fan-out with safe fallbacks and full review gates.',
        orchestrationDepth: 'balanced',
        verification: 'standard',
        subagents: 'balanced',
        selection: {
            workers: 2,
            optimizationProfile: 'standard',
            backendMode: 'default',
            backendSelectors: {
                memoryBackend: 'sqlite-memory',
                compressionBackend: 'deterministic-token-supremacy',
                dslCompiler: 'deterministic-nxl-compiler',
            },
            reviewPolicy: { mode: 'full' },
            continuationPolicy: { mode: 'suggest' },
        },
    },
    {
        id: 'deep',
        name: 'Deep',
        summary: 'Hermes-style deeper reasoning: higher worker count, experimental ranking/compression, and broader continuation support.',
        orchestrationDepth: 'deep',
        verification: 'strict',
        subagents: 'aggressive',
        selection: {
            workers: 4,
            optimizationProfile: 'max',
            backendMode: 'experimental',
            backendSelectors: {
                memoryBackend: 'temporal-hyperbolic-memory',
                compressionBackend: 'meta-compression',
                dslCompiler: 'agentlang-neural-compiler',
            },
            reviewPolicy: { mode: 'full' },
            continuationPolicy: { mode: 'suggest' },
        },
    },
    {
        id: 'release',
        name: 'Release',
        summary: 'Ship-focused preset: deep planning, strict review, and release-ready verification defaults.',
        orchestrationDepth: 'deep',
        verification: 'strict',
        subagents: 'balanced',
        selection: {
            workers: 3,
            optimizationProfile: 'max',
            backendMode: 'experimental',
            backendSelectors: {
                memoryBackend: 'temporal-hyperbolic-memory',
                compressionBackend: 'meta-compression',
                dslCompiler: 'agentlang-neural-compiler',
            },
            reviewPolicy: { mode: 'full' },
            releasePolicy: { mode: 'ship-ready' },
            continuationPolicy: { mode: 'manual' },
        },
    },
];
export function listExecutionPresets() {
    return EXECUTION_PRESETS.map((preset) => ({
        ...preset,
        selection: {
            ...preset.selection,
            backendSelectors: { ...(preset.selection.backendSelectors ?? {}) },
            reviewPolicy: preset.selection.reviewPolicy ? { ...preset.selection.reviewPolicy } : undefined,
            releasePolicy: preset.selection.releasePolicy ? { ...preset.selection.releasePolicy } : undefined,
            continuationPolicy: preset.selection.continuationPolicy ? { ...preset.selection.continuationPolicy } : undefined,
        },
    }));
}
export function resolveExecutionPreset(id) {
    if (!id)
        return undefined;
    return listExecutionPresets().find((preset) => preset.id === id.toLowerCase());
}
export function applyExecutionPreset(input, presetId) {
    const preset = resolveExecutionPreset(presetId);
    if (!preset)
        return { ...input };
    return {
        ...preset.selection,
        ...input,
        backendSelectors: {
            ...(preset.selection.backendSelectors ?? {}),
            ...(input.backendSelectors ?? {}),
        },
        reviewPolicy: {
            ...(preset.selection.reviewPolicy ?? {}),
            ...(input.reviewPolicy ?? {}),
        },
        releasePolicy: {
            ...(preset.selection.releasePolicy ?? {}),
            ...(input.releasePolicy ?? {}),
        },
        continuationPolicy: {
            ...(preset.selection.continuationPolicy ?? {}),
            ...(input.continuationPolicy ?? {}),
        },
    };
}
