import type { PermissionManager } from '../permissions/manager.js'; import type { ToolDenial } from '../types/tools.js'; import type { AgentRecord } from '../tools/agent/index.js'; /** The narrow slice of PermissionManager the background gate consults. */ export type BackgroundPermissionManager = Pick; export type BackgroundPermissionOutcome = { readonly approved: true; readonly modifiedArgs?: Record | undefined; } | { readonly approved: false; readonly error: string; readonly denial: ToolDenial; }; /** * Broker a background/subagent tool call through the session permission mode. * * Mirrors the foreground tool-runtime's permission handling so a background * agent is subject to the SAME mode: 'inherit' (default) applies the mode's * allow/ask/refuse matrix (allow-all approves everything with zero new * friction; prompt/plan/accept-edits/custom apply as configured, with any ask * bubbling through the injected requestPermission handler carrying subagent * attribution). The escape-hatch `permissions.backgroundAgents: 'allow-all'` * exempts background agents entirely. When no manager is wired the call is left * ungated (unchanged legacy behavior for isolated contexts/tests). */ export declare function gateBackgroundToolCall(context: { readonly permissionManager?: BackgroundPermissionManager | undefined; }, /** * `template` is OPTIONAL here, unlike on AgentRecord. * * The body has always treated it as optional, it emits the attribution's * `template` only when the record carries a truthy one, because * PermissionAttribution.template is itself optional. Requiring it came from * `Pick`, not from anything this function * does, and it made every caller that has an id and no archetype invent one. * Widening, so the real caller in orchestrator-runner.ts (which passes a full * AgentRecord) is unaffected. */ record: Pick & { readonly template?: AgentRecord['template'] | undefined; }, toolName: string, args: Record): Promise; //# sourceMappingURL=background-permission-gate.d.ts.map