import type { DelegationSpawnRequest } from "./spawner-types.js"; type PrimitivePermission = Record; type ValidatedAgent = { name: string; provider?: string; model?: string; description?: string; permission?: PrimitivePermission; tools?: Record; }; type DelegateParams = { parentSessionId: string; agent: string; prompt: string; title?: string; context?: string; stackOnSessionId?: string; workingDirectory?: string; worktree?: string; provider?: string; model?: string; }; export type { ValidatedAgent, DelegateParams }; /** * Build a canonical SDK spawn request from delegation dispatch parameters. */ export declare function buildSdkSpawnRequest(params: DelegateParams, agent: ValidatedAgent, workingDirectory: string): DelegationSpawnRequest; /** * Derive the least-privilege delegated tool profile from selected agent * primitive metadata, capability gate resolution, and task intent. * * Resolution order: explicit metadata → capability gate → intent → fallback. * The capability gate is additive — its tools are unioned with explicit metadata. * * @param params - User delegation request details used for task-intent checks. * @param agent - Selected OpenCode agent metadata from live or local primitive data. * @returns Conservative prompt-time tool allowlist for the child session. * * @example * ```typescript * const profile = resolveDelegationPermissionProfile({ agent: "critic", prompt: "review", parentSessionId: "p" }, { name: "critic" }); * // profile.mode === "review-only" * ``` */ export declare function resolveDelegationPermissionProfile(params: Pick, agent?: ValidatedAgent): DelegationSpawnRequest["permissionProfile"]; //# sourceMappingURL=spawn-request-builder.d.ts.map