import type { ContextItem } from '../types'; /** * A constraint declares that if one item is included, another must be too. * * Example: if tool "search" is included, its few-shot example must also be. */ export interface Constraint { /** The item ID that triggers this constraint. */ ifIncluded: string; /** The item ID that must also be included. */ thenRequire: string; } /** * Enforce dependency constraints on a set of included items. * * If an included item triggers a constraint, the required dependency is pulled * from the `available` pool. If adding the dependency would exceed the budget, * the *triggering* item is removed instead (since its constraint can't be met). * * Loops until stable to handle transitive dependencies (A→B→C). A `failedDeps` * set prevents infinite loops by tracking dependencies that could not be resolved. * * Mutates and returns the included array. */ export declare function enforceConstraints(included: ContextItem[], available: ContextItem[], constraints: Constraint[], budget: number): { included: ContextItem[]; added: ContextItem[]; removed: ContextItem[]; };