import type { ModelPricing } from './types.js'; /** * Where a prompt is actually going. * * Trazum priced one vendor, so defaulting to Claude cost nothing. Pricing seven * made that default a **wrong number**: `trazum check src/prompts.ts` billed a * file that calls OpenAI against Claude Opus 5 and said so with a straight face. * The fix is not a better default — it is reading what the code already says. * * Everything here is **evidence-first**. A detection that cannot name what it * saw is a guess wearing a result's clothes, and this feeds a command used as a * CI gate. Every answer carries the line it came from, so a wrong one is * arguable rather than mysterious. * * **It declines when the file points two ways.** A module importing both * `openai` and `@anthropic-ai/sdk` is a module Trazum cannot price without * picking a side, and picking silently is how somebody budgets against the wrong * provider for a month. The conflict is reported and the caller falls back to * whatever they configured. * * Detection sits **between config and defaults** in the usual layering: a flag * beats config, config beats detection, detection beats the built-in default. * Reading the code is better than assuming, and worse than being told. */ export type EvidenceKind = /** `model: 'gpt-5'` — names the model outright, so nothing beats it. */ 'model-literal' /** `from 'openai'` — names the provider but not which model. */ | 'sdk-import' /** `https://api.deepseek.com` — a base URL pinned in the source. */ | 'base-url' /** `// trazum:prompt name model=gpt-5` — the author said so directly. */ | 'marker'; export interface Evidence { kind: EvidenceKind; /** The text that produced it, so the reader can go and look. */ detail: string; /** 1-based line, when it came from a specific place in the file. */ line?: number; provider?: string; model?: string; } export interface Detection { /** The provider, or null when nothing was found or the file disagreed. */ provider: string | null; /** The exact model, when something named one. */ model: string | null; /** What was found, strongest first. Empty when nothing was. */ evidence: Evidence[]; /** * Evidence pointing somewhere other than the answer. * * Non-empty means the file names more than one provider, and `provider` is * null: two answers is not a weaker version of one answer. */ conflicts: Evidence[]; } export interface DetectOptions { /** The catalogue to recognise model names from. */ models?: ModelPricing[]; } /** * Works out which provider a source file talks to, and says why. * * Returns `provider: null` both when nothing was found and when the file named * more than one — the caller cannot act on either, and `conflicts` distinguishes * them for the reader. */ export declare function detectFromSource(source: string, options?: DetectOptions): Detection; //# sourceMappingURL=detect.d.ts.map