/** * [WHO]: inferScenariosFromSchema(), MCPSchemaFieldRule, SCENARIO_RULES * [FROM]: Depends on nothing — pure data + helper that walks JSON Schema. * [TO]: Consumed by core/mcp/mcp-adapter.ts (buildMcpToolGuidance). * [HERE]: core/mcp/mcp-schema-inference.ts - schema-driven scenario inference. * * Server-level hints (mcp-server-hints.ts) describe what an MCP *server* is for * at a coarse grain. Schema inference describes what a specific *tool* takes * as input, which lets us add tool-grain hints ("takes a `path` arg → it's a * file operation") that the server-level table can't express. * * The output is intentionally short — a list of human-readable scenario * phrases — and gets merged into the LLM guidance / description. We bound the * total length downstream so callers can fit the result into the guidance * budget without exploding prompt size when many tools are present. * * Matching is case-insensitive. Field names that overlap (e.g. a tool with * both `path` and `url` properties) yield multiple phrases; dedup keeps the * first match per rule but lets different rules each contribute one phrase. */ export interface MCPSchemaFieldRule { /** Field name substrings (lower-cased). Match is `any rule.any(substring)`. */ readonly substrings: readonly string[]; /** Human-readable scenario phrase that the rule implies. */ readonly phrase: string; } /** * Rule order matters: more specific rules come first. When a property name * matches multiple rules we keep one phrase per *rule*, not per substring, * so vocabulary stays tight. The order also determines priority when later * rules overlap — earlier phrases win for the same property. */ export declare const SCENARIO_RULES: readonly MCPSchemaFieldRule[]; /** * Walk an MCP tool inputSchema's `properties` and return a deduplicated * list of scenario phrases implied by the field names. Schemas without * `properties` (or with no recognized field names) yield `[]`. Properties * whose name matches a known noise substring (id, name, type, …) contribute * nothing. * * Output is bounded to `maxRules` rules (default 3) so a single tool can't * balloon the guidance text when its schema has many recognizable fields. * Earlier rules (more specific) win; later matches are dropped. */ export declare function inferScenariosFromSchema(inputSchema: unknown, maxRules?: number): string[]; /** * Render a list of scenario phrases into a single sentence fragment suitable * for appending to guidance / description text. Returns "" when the list is * empty so callers can `result || fallback` without ceremony. * * Phrase order matches the rule order (more specific first). */ export declare function renderSchemaInferences(phrases: readonly string[]): string;