/** Tool policy helpers (Rust-backed). */ import { PolicyContextNative } from "./native.js"; import type { JsonRecord } from "./types.js"; type PolicyContext = InstanceType; export type SystemToolPolicy = "always_include" | "prune_optional" | "prune_all" | "prune_optional_descriptions" | "prune_all_descriptions"; export type MCPToolPolicy = "always_include" | "prune_optional" | "prune_all" | "prune_optional_descriptions" | "prune_all_descriptions"; export type ToolPolicy = "always_include" | "prune_optional" | "prune_all" | "prune_optional_descriptions" | "prune_all_descriptions"; /** Batch override on native `PolicyContext.toolKind` (`"system"` | `"mcp"`). */ export type ToolKind = "system" | "mcp"; export { PolicyContextNative as PolicyContext }; /** Set batch tool-kind override on a native policy context (mirrors Python apply_executor_tool_kind). */ export declare function applyToolKind(ctx: PolicyContext, kind: ToolKind): PolicyContext; /** * Map description policies to base scoring policies for partition/pipeline. * Copies toolKind (mirrors Python scoring_policy_context). */ export declare function scoringPolicyContext(ctx: PolicyContext): PolicyContext; export declare function toolPolicies(): string[]; export declare function policyContextFromValues(config: JsonRecord): PolicyContext; export declare function effectivePolicy(toolId: string, ctx: PolicyContext): ToolPolicy; export declare function toolPassThrough(toolId: string, ctx: PolicyContext): boolean; export declare function batchToolPassThrough(toolIds: string[], ctx: PolicyContext): boolean[]; export declare function rootToolIdFromChunk(item: JsonRecord): string; export declare function requestPassThrough(tools: JsonRecord[], ctx: PolicyContext): boolean; export declare function isNonSystemToolId(toolId: string): boolean; export declare function isSystemToolId(toolId: string): boolean; export declare function chunkToolId(item: JsonRecord): string; export declare function isNonSystemChunk(item: JsonRecord): boolean; export declare function isSystemChunk(item: JsonRecord): boolean; export declare function isDecomposedToolRootChunk(item: JsonRecord): boolean; export declare function isDecomposedOptionalPropertyChunk(item: JsonRecord): boolean; export declare function isSystemRootChunk(item: JsonRecord): boolean; export declare function isMcpRootChunk(item: JsonRecord): boolean; export declare function isSystemOptionalChunk(item: JsonRecord): boolean; export declare function isMcpOptionalChunk(item: JsonRecord): boolean; export declare function classifyOptionalChunksBatch(items: JsonRecord[]): { system: boolean[]; mcp: boolean[]; }; export declare function needsPartition(ctx: PolicyContext): boolean; export declare function needsPrunedRecompose(ctx: PolicyContext): boolean; export declare function systemToolsPassThrough(ctx: PolicyContext): boolean; export declare function mcpToolsPassThrough(ctx: PolicyContext): boolean; export declare function fullPassThrough(ctx: PolicyContext): boolean; export declare function catalogNeedsPartition(data: JsonRecord, ctx: PolicyContext): boolean; export declare function catalogNeedsPrunedRecompose(data: JsonRecord, ctx: PolicyContext): boolean; export declare function partitionCatalog(data: JsonRecord, ctx: PolicyContext): [JsonRecord, JsonRecord]; export declare function mergeCatalog(processed: JsonRecord, pinned: JsonRecord): JsonRecord; export declare function stashSystemTools(tools: JsonRecord[]): JsonRecord[]; export declare function restoreSystemTools(stash: JsonRecord[]): JsonRecord[]; export declare function stashMcpTools(tools: JsonRecord[]): JsonRecord[]; export declare function restoreMcpTools(stash: JsonRecord[]): JsonRecord[]; export declare function mergeToolsPreservingOrder(original: JsonRecord[], prunedByName: Record, stashedByName: Record): JsonRecord[]; export declare function anthropicToolIsSystem(tool: JsonRecord): boolean; export declare function anthropicToolIsMcp(tool: JsonRecord): boolean; export declare function splitAnthropicTools(tools: JsonRecord[]): [JsonRecord[], JsonRecord[]]; export declare function entriesForPolicy(allEntries: JsonRecord[], ctx: PolicyContext): JsonRecord[]; export declare function toolsForCatalog(tools: JsonRecord[], ctx: PolicyContext): JsonRecord[]; export declare function systemRequiredEnumValues(data: JsonRecord): string[]; export declare function mcpRequiredEnumValues(data: JsonRecord): string[]; export declare function requiredEnumValuesByTool(data: JsonRecord): Record; export declare function optionalLeafSurvivedRerank(item: JsonRecord, ctx: PolicyContext, rerankScore?: number | null, llmSelectedPaths?: Iterable | null): boolean; export declare function filterRecomposeJsonEntries(jsonList: JsonRecord[], ctx: PolicyContext, rerankScore?: number | null, llmSelectedPaths?: Iterable | null): JsonRecord[]; export declare function mitigateEmptyOptionalProperties(entries: JsonRecord[], catalogIndex: JsonRecord, ctx: PolicyContext, postRerankScored: JsonRecord | null | undefined, pipeline: string[]): JsonRecord[]; export declare function ensureRootJsonForSurvivingTools(entries: JsonRecord[], buildCatalog: JsonRecord): JsonRecord[]; export declare function jsonEntriesForRecompose(data: JsonRecord, pinned: JsonRecord | null | undefined, buildCatalog: JsonRecord, postRerankScored: JsonRecord | null | undefined, ctx: PolicyContext, catalogIndex: JsonRecord, pipeline: string[]): JsonRecord[]; export declare function appendDescriptionReinstateEntries(entries: JsonRecord[], buildCatalog: JsonRecord, catalogIndex: JsonRecord, ctx: PolicyContext): JsonRecord[]; export declare function needsDescriptionReinstate(ctx: PolicyContext): boolean; export declare function isDescriptionPolicy(policy: string): boolean; export declare function scoringPolicy(policy: string): ToolPolicy; export declare function directRootOptionalChunksForTool(items: JsonRecord[], toolId: string): JsonRecord[]; export declare function rootChunkPropertiesEmpty(item: JsonRecord): boolean; export declare function toolIdHasEmptyDecomposedRoot(catalogIndex: JsonRecord, toolId: string): boolean; export declare function toolIdHadEmptyOriginalRootProperties(catalogIndex: JsonRecord, toolId: string): boolean; export declare function isDirectRootOptionalPropertyChunk(item: JsonRecord): boolean; export declare function dropRecomposedToolsWithEmptyProperties(tools: JsonRecord[], catalogIndex: JsonRecord, ctx: PolicyContext): JsonRecord[]; //# sourceMappingURL=policies.d.ts.map