/** * Tool surface control. * * Every tool schema Lemma advertises is injected into the model's system prompt and * re-sent on every single request of the session — charged before Lemma has saved * anything, and charged even for tools the project can never use (Terraform schemas * in a repo with no `.tf` files). Exact per-turn cost is measured, not hardcoded: * see `token_budget` → perTurnOverhead.schemaTokens. (A hardcoded figure lived here * and drifted from the binary twice — AN-02 — so this comment no longer cites one.) * * So the advertised list is narrowed to what this project can actually use. Nothing is * removed: every handler stays registered, and `lemma_toolbox` exposes the rest by name * on demand — a one-time catalog instead of the full schema set every turn. * * The list is resolved once at startup and never mutated mid-session. It lives in the * cached prefix of every request; changing it (e.g. lazily "unlocking" tools via * notifications/tools/list_changed) invalidates that cache and re-charges the whole * context at full price, which costs far more than the schemas it would defer. */ export type ToolProfile = "auto" | "core" | "full"; /** * Tools that pay for their schema in an ordinary coding session: reading, searching, * patching, AST context, exact-hash caching, and the ledger. Everything else is * situational and reachable through `lemma_toolbox`. */ export declare const CORE_TOOL_NAMES: string[]; /** * Code review is a mode the user enters, not a property of the repo — and it cannot be * detected at startup. Gating these on `.git` advertised them in every git repo, which is * every repo: ~670 tokens per turn for tools most sessions never touch. They stay * registered and `lemma_toolbox` finds them by query the moment a review actually starts. */ export declare const REVIEW_TOOL_NAMES: string[]; export interface ResolvedToolSurface { profile: ToolProfile; /** Schemas advertised in tools/list. */ advertised: T[]; /** Registered and callable, but not advertised — reachable through `lemma_toolbox`. */ hidden: T[]; /** Situational groups that matched this project. */ activeGroups: string[]; } export interface ResolveOptions { /** * Returns false for a tool this session is not licensed to run. Such a tool must not be * advertised: its schema would be re-sent every turn purely to be refused at call time. * It stays registered and discoverable through `lemma_toolbox`, which is where a user * finds out the capability exists and what it takes to unlock it. */ isEntitled?: (name: string) => boolean; } export declare function resolveToolSurface(allDefinitions: T[], cwd?: string, options?: ResolveOptions): ResolvedToolSurface; /** * One-line-per-tool catalog of everything not advertised, so the model can find and * invoke a hidden tool without its schema having been resident all session. */ export declare function buildToolboxCatalog(hidden: Array<{ name: string; description?: string; }>, query?: string): string; //# sourceMappingURL=tool-profiles.d.ts.map