/** * Non-interactive dependency construction for the MCP server. Thin over the * shared `core/run` `buildCheckDeps` factory (so `mcp/` never imports `cli/` - * hard rule #1); adds MCP-specific policy: a default cost cap and no confirm * gate (tools pass `yes: true`). */ import { type RunCheckDeps, type RunGenerateQueriesDeps, type RunShoppingDeps } from '../core/run/index.js'; import { type SnapshotFs } from '../core/output/index.js'; import { type Fetcher } from '../core/fetcher/index.js'; import type { EngineId } from '../core/types.js'; /** Default hard cap on a single check_visibility run (agent may override). */ export declare const DEFAULT_MCP_MAX_COST = 0.5; /** * Default cap PER PRODUCT for shopping_check (agent may override with max_cost). * * A shopping run is much larger than a check - up to 10 products x 4 prompts x * every keyed engine - so the flat $0.50 would truncate most multi-product runs * into a partial ranking. Scaling with the list keeps a 2-product call cheap * while letting a 10-product call finish and mean something. */ export declare const DEFAULT_MCP_SHOPPING_PER_PRODUCT_USD = 0.2; export interface ToolContext { /** State dir (snapshots/profile/queries) for a domain. */ resolveStateDir(domain: string): string; /** Full check deps for runCheck; `maxCost` overrides the default cap. */ checkDeps(opts: { engines?: EngineId[]; maxCost?: number; availableEngines: EngineId[]; }): Promise; /** Deps for runGenerateQueries (async: resolves the judge once). */ queryDeps(): Promise; /** * Deps for runShopping (M12a). `productCount` sizes the default cap; an * explicit `maxCost` from the agent always wins. */ shoppingDeps(opts: { productCount: number; engines?: EngineId[]; maxCost?: number; availableEngines: EngineId[]; }): Promise; /** * A FRESH fetcher for one tool invocation. The default fetcher's cache is a * permanent per-instance Map (built for a single CLI run), so a fetcher must * never be shared across calls in a long-lived MCP session - that would serve * stale responses and grow unbounded. Each tool call gets its own. */ newFetcher(): Fetcher; /** Snapshot fs for get_snapshot_diff. */ snapshotFs: SnapshotFs; /** Engines that have keys in this environment. */ availableEngines(): EngineId[]; /** ISO clock. */ now(): string; /** Stderr log for judge notices (NEVER stdout - it is the MCP stream). */ log(msg: string): void; } export interface DefaultToolContextInput { env: Record; cwd: string; homeDir: string; isProjectWritable: boolean; fetcher?: Fetcher; now?: () => string; /** Where notices go; defaults to process.stderr (never stdout). */ log?: (msg: string) => void; } export declare function defaultToolContext(input: DefaultToolContextInput): ToolContext;