/**
 * Built-in proxymodel definitions.
 * These are always available and can be overridden by local YAML files.
 */
import type { ProxyModelDefinition } from './schema.js';

export function getBuiltInProxyModels(): Map<string, ProxyModelDefinition> {
  const models = new Map<string, ProxyModelDefinition>();

  models.set('default', {
    kind: 'ProxyModel',
    metadata: { name: 'default' },
    spec: {
      controller: 'gate',
      controllerConfig: { byteBudget: 8192 },
      stages: [
        { type: 'passthrough' },
        { type: 'paginate', config: { pageSize: 8000 } },
      ],
      appliesTo: ['prompt', 'toolResult'],
      cacheable: false,
    },
    source: 'built-in',
  });

  models.set('subindex', {
    kind: 'ProxyModel',
    metadata: { name: 'subindex' },
    spec: {
      controller: 'gate',
      controllerConfig: { byteBudget: 8192 },
      stages: [
        { type: 'section-split', config: { minSectionSize: 2000, maxSectionSize: 15000 } },
        { type: 'summarize-tree', config: { maxSummaryTokens: 200, maxGroupSize: 5, maxDepth: 3 } },
      ],
      appliesTo: ['prompt', 'toolResult'],
      cacheable: true,
    },
    source: 'built-in',
  });

  return models;
}
