/** * Making KONECK fit a small window instead of explaining why it does not. * * Measured: the instructions come to about 1.5k tokens and the tool descriptions to 2.6k, so a * request starts at nearly 4k. Against Ollama's default 4,096 that leaves a few hundred tokens for * the conversation, the reply and every file read — and a session that plans three steps, calls * `plan` successfully, and then returns three empty turns in a row is what that looks like from * outside. Telling somebody to raise the window is right, and it is also the only advice KONECK * had. This is the half within its own control. * * Nine of the twenty-three tools are git subcommands costing about 550 tokens between them, and * every one of them is a line of shell. `execute_command` is already there. On a large window the * dedicated tools are worth having — they are safer and they read better in a transcript — and on * a small one they are the difference between working and not. * * Nothing here is silent. What was dropped is reported once, because a tool list quietly reduced * is a capability that appears to be missing rather than deferred. */ /** Below this, the overhead matters more than the convenience. */ export declare const LEAN_THRESHOLD = 8192; /** * The tools a coding session cannot do without. * * Read, write, edit, look around, search, run things, and keep a plan. Everything else is either * reachable through `execute_command` or is not needed to do the work in front of it. */ export declare const ESSENTIAL_TOOLS: readonly string[]; export declare function shouldRunLean(limit: number): boolean; export interface LeanTool { type: 'function'; function: { name: string; description: string; parameters: unknown; }; } export interface LeanResult { tools: LeanTool[]; /** Names left out, so it can be said rather than discovered. */ dropped: string[]; beforeChars: number; afterChars: number; } /** * The tool list cut down to what fits. * * Keeps the essential set, in the order given, with one sentence of description each and no prose * in the parameters. A tool that is not in the essential set but has no dedicated replacement is * still dropped — the model is told what happened, and `execute_command` covers the gap. */ export declare function leanTools(tools: ReadonlyArray<{ type?: string; function: { name: string; description?: string; parameters?: unknown; }; }>): LeanResult; /** One line telling the model what it no longer has, and what to use instead. */ export declare function leanToolNotice(dropped: readonly string[]): string; /** What the user is told, once, so a smaller tool list is never a silent cap. */ export declare function leanModeNotice(result: LeanResult, limit: number): string; /** * The tool that fetches the others. * * Dropping a tool to save schema is a real loss: the model cannot use what it cannot see, so a * lean session genuinely could not browse, or ask the compiler, or spawn a sub-agent, and the run * had to make do. Deferring costs a fraction of that — a name and a few words each, instead of a * full schema each — and loses nothing, because anything named can be fetched the moment it is * wanted. * * Measured on this tool set: sixteen schemas are 12,165 characters. The seven essentials plus this * one plus an inventory of the other nine come to roughly a third of that, and the nine are still * there for the asking. */ export declare const FIND_TOOLS = "find_tools"; export declare function findToolsSchema(available: readonly string[]): LeanTool; /** * Which deferred tools a request is asking for. * * Matched on the name first, because a model that has been given a list of names will use one. Then * on the words in the description, so "browse a page" finds the browser without anybody having * written that phrase down. An unmatched query returns everything rather than nothing: the point is * to unblock, and a short list the model can choose from beats a refusal it has to work around. */ export declare function matchDeferred(query: string, pool: ReadonlyArray<{ function: { name: string; description?: string; }; }>): string[]; /** What the model is told when its tool list is reduced but nothing is actually gone. */ export declare function deferredToolNotice(deferred: readonly string[]): string; //# sourceMappingURL=lean-mode.d.ts.map