/**
 * Template resolution for subagent spawn — resolves template config,
 * merges tool policies, and generates auto-labels.
 */
export type TemplateResolveResult = {
    templateApplied: true;
    templateName: string;
    model?: string;
    thinking?: string;
    toolsDeny?: string[];
    toolsAllow?: string[];
    systemPrompt?: string;
    timeoutSeconds?: number;
    cleanup?: "delete" | "keep";
    maxSpawnDepth?: number;
    skills?: string[];
    env?: Record<string, string>;
    error?: undefined;
};
export type TemplateResolveError = {
    templateApplied?: undefined;
    error: string;
};
export type TemplateResolveOutcome = TemplateResolveResult | TemplateResolveError;
/**
 * Resolve a template for spawn. Returns null if no template name is given
 * (existing behavior preserved). Returns an error result if template not found.
 * Returns resolved fields if template is valid.
 */
export declare function resolveTemplateForSpawn(params: {
    templateName?: string;
    task: string;
    label?: string;
    agentId: string;
    depth: number;
    maxDepth: number;
    outputDir?: string;
    previousOutput?: string;
}): TemplateResolveOutcome | null;
/**
 * Merge tool policies from template and agent config.
 * - Deny: union of template deny + agent deny (deduplicated)
 * - Allow: if template allow set, intersect with agent available tools
 *   (template can only restrict, never expand tool access)
 * - Neither side can relax the other's restrictions
 */
export declare function mergeToolPolicies(params: {
    templateAllow?: string[];
    templateDeny?: string[];
    agentDeny?: string[];
    agentAvailableTools?: string[];
}): {
    deny: string[];
    allow?: string[];
};
/**
 * Resolve auto-label for a template-spawned subagent.
 * If explicit label given, return it unchanged.
 * Otherwise prefix template name to task (truncated to reasonable length).
 */
export declare function resolveAutoLabel(params: {
    templateName: string;
    explicitLabel?: string;
    task: string;
}): string;
