import type { ThinkingLevel } from "../internal/harness.js"; import type { Model } from "../internal/llm.js"; import type { ModelRef, ModelRole, ModelRoles } from "./types.js"; export type { ModelRole, RoleSpec, ModelRoles } from "./types.js"; /** Resolve a string ModelRef against the catalog (a Model object passes through). */ export declare function resolveModel(ref: ModelRef, models?: Record): Model; /** 档位降档链(强→弱)。解析某档无绑定时沿链向后找第一个有绑定的档(fail-open 可用性优先;绑定缺口 * 在部署 catalog 审计面可见)。`ultra` 预留:排在 `max` 前,今天不绑,未来加档零码改。 */ export declare const DEFAULT_TIER_ORDER: readonly string[]; /** CC 档位词 → sema 档位(内置固定,兼容层):fable/mythos→max · opus→pro · sonnet→flash · haiku→lite。 */ export declare const CC_MODEL_TIER_ALIASES: Readonly>; export declare function expandTiers(models: Record | undefined, tiers: Record | undefined): Record | undefined; export interface ModelMention { /** The matched model name — always one of `allowedNames` — or undefined if none was found. */ model?: string; /** The message with the matched `@model` token removed and whitespace tidied. */ cleanedText: string; } /** * Parse a leading/inline `@model` mention out of a user message, restoring the chat "@-model" UX. * Returns the matched model **name** (a catalog ref the caller resolves), never a Model object — and * **only ever a name from `allowedNames`**. This is the security boundary: untrusted end-user text can * pick *which configured model* to use, but can never inject an arbitrary `baseUrl`/`apiKey`/Model * (see design/11). Matches the first allow-listed mention; the rest of the text is returned cleaned. * * Typical use: `const { model, cleanedText } = parseModelMention(userMsg, Object.keys(deps.models));` * then `runTask({ objective: cleanedText, model })` (omit `model` to fall back to the default role). */ export declare function parseModelMention(text: string, allowedNames: Iterable): ModelMention; /** * Role → 档位默认表(clay 拍 2026-07-11:「role 体系用户不感知」)。配了 `RunnerDeps.tiers` 的部署, * 各 role 未显式配置时自动落到语义档位——用户/壳只感知档位,roles 降级为内部路由层: * - `default` → `pro`(主力档兜底;用户/部署 roles.default / TaskSpec.model 恒可覆盖); * - `summarize` → `flash`(压缩本该便宜;flash 未绑沿降档链到 lite); * - `advisor` → 第一档(`ultra` 起,未绑降档到 max/pro——teacher 用最强的); * - `verifier` → `pro`; * - `subagent`/`team`/`synthesize` 无档位默认 = 走 FALLBACK 继承主模型(LLM 可经 model 参数自选档)。 * 未配 tiers 的部署:catalog 无 TIERS_ACTIVE 标记 → 表整体 INERT,行为与从前逐字节一致 * (即使 catalog 恰有裸模型名 `pro`/`flash` 也不入档位路由——INERT 靠配置成立,不靠键名运气)。 */ export declare const ROLE_TIER_DEFAULTS: Readonly>>; export interface ResolvedRole { model: Model; /** The effective thinking level: explicit `spec.thinking` wins, else the role's default. */ thinking?: ThinkingLevel; /** The requested role's preset system prompt, if it set one (independent of model fallback). */ systemPrompt?: string; } /** * Resolve the model (and default thinking) for a task. Explicit `spec.model` wins; otherwise walk the * `modelRole`'s fallback chain over the merged roles (task overrides runner) and use the first role * that supplies a model. Throws a helpful error if nothing resolves. */ export declare function resolveTaskModel(spec: { model?: ModelRef; modelRole?: ModelRole; roles?: ModelRoles; thinking?: ThinkingLevel; }, deps: { models?: Record; roles?: ModelRoles; }): ResolvedRole; /** * Resolve a role's model **only if that exact role key is configured** (no fallback chain). Used for * the `summarize` compaction model: override only when a summarize-specific model is set, otherwise * let the caller fall back to the main model (unchanged behavior). */ export declare function roleModelIfSet(role: ModelRole, spec: { roles?: ModelRoles; }, deps: { models?: Record; roles?: ModelRoles; }): Model | undefined; //# sourceMappingURL=roles.d.ts.map