import type { McpServerConfig } from '../../services/mcp-manager.js'; export declare function getContextBudgetForModel(model?: string): number; /** Usable input-window estimate (bytes) for the model, before headroom. */ export declare function getInputWindowForModel(model?: string): number; export type CliAutoLoadedEstimate = { /** Total bytes of memory files plus their transitively imported rule files. */ bytes: number; /** Number of distinct files that contributed (memory files + imports). */ fileCount: number; }; /** * Best-effort estimate of the byte footprint the Claude CLI auto-loads from the * workspace cwd: the memory files (CLAUDE.md / AGENTS.md) plus every file they * pull in via `@import` references, followed transitively. Never throws — any * unreadable file is simply skipped, so the worst case is an under-count that * falls back to today's behavior. Returns `{ bytes: 0, fileCount: 0 }` when no * memory file exists. */ export declare function estimateCliAutoLoadedContext(workspace: string): CliAutoLoadedEstimate; export type McpToolDefinitionEstimate = { /** Estimated bytes the connected servers' tool definitions add to the prompt. */ bytes: number; /** Number of configured servers that contributed. */ serverCount: number; }; /** * Best-effort estimate of the byte footprint the connected MCP servers' tool * definitions add to the CLI system prompt. The Salesforce MCP is recognized by * its `@salesforce/mcp` command and weighted by its `--toolsets` argument * (`all` is the costly case); every other server contributes a flat baseline. * Returns `{ bytes: 0, serverCount: 0 }` for an empty set. Never throws. */ export declare function estimateMcpToolDefinitionBytes(servers: Record | undefined): McpToolDefinitionEstimate; /** * Prompt budget available to bridge-managed context and history after the * Claude CLI's fixed workspace instructions and MCP tool definitions. * `getContextBudgetForModel` is intentionally not used here: it only limits * what `buildContext` injects and is much smaller than the model input window. */ export declare function getHistoryCompactionBudget(workspace: string, model?: string, servers?: Record): number; export type FirstMessageGuardResult = { /** True when the measurable prompt exceeds the model's safe input window. */ exceeded: boolean; /** Combined bytes of CLI-loaded memory + MCP tool defs + injected context + message. */ totalBytes: number; /** Safe budget (window * ratio) the total was compared against. */ budgetBytes: number; /** CLI-auto-loaded footprint that prompted the trim, when exceeded. */ cliEstimate: CliAutoLoadedEstimate; /** MCP tool-definition footprint the connected servers add to every turn. */ mcpEstimate: McpToolDefinitionEstimate; }; /** * First-message guard (GH #373): on a fresh turn there is no history, so the * proactive-compaction path never runs and nothing accounts for the CLI's * auto-loaded memory files. Measure CLI memory + injected context + message * against the model's safe input window so the caller can trim and warn instead * of letting the CLI reject the turn with "Input is too long". */ export declare function evaluateFirstMessageBudget(workspace: string, injectedContext: string, message: string, model?: string, mcpServers?: Record): FirstMessageGuardResult; export type BuildContextOptions = { vaultFiles?: Array<{ path: string; content: string; tags?: string[]; }>; maxBytes?: number; }; export type BuildContextResult = { context: string; matchedSkills: string[]; }; export declare function buildContext(workspace: string, message: string, options?: BuildContextOptions): BuildContextResult; type MatchedSkill = { id: string; content: string; score: number; }; export declare function matchSkills(workspace: string, message: string): MatchedSkill[]; export {};