import type { RouteContext } from './router.js';
import { type InputSource, type OutputFile } from './artifacts.js';
export declare const A2A_MAX_DEPTH_DEFAULT = 1;
export declare const A2A_TIMEOUT_MS_DEFAULT: number;
/** Hard upper bound — refuse caller-supplied `timeoutMs` larger than this so
 *  an agent can't accidentally write `timeoutMs: 86400000` and block A2A
 *  forever. Override with IMHUB_A2A_MAX_TIMEOUT_MS. */
export declare const A2A_TIMEOUT_MS_MAX: number;
export declare function isA2AEnabled(): boolean;
export declare function getA2AMaxDepth(): number;
export declare function getA2ATimeoutMs(ctx?: {
    platform?: string;
    channelId?: string;
    threadId?: string;
}): number;
export declare function getA2AMaxTimeoutMs(): number;
export interface CallAgentOpts {
    /** Parent inline-job id (caller). NULL for top-level user calls. */
    parentJobId?: number | null;
    /** Caller's call_depth. New row will be set to caller + 1. */
    callerDepth?: number;
    /** Caller agent name (for self-call check). RouteContext doesn't carry
     *  this in its type today; bus.callAgent looks it up from RunContext
     *  + the audit log's per-run state. Optional — when unset we skip the
     *  self-call check; the depth ceiling still prevents runaway chains. */
    callerAgent?: string;
    /** Override timeout. Falls back to env / default. */
    timeoutMs?: number;
    /** L2: files to drop in the callee's _agim-input/ before it runs.
     *  Each input has a target filename plus exactly one of:
     *    - fromAbsolutePath: copy/hard-link from a path on disk
     *    - fromCallerOutput: pull from caller's own _agim-output/
     *      (requires parentJobId so artifacts knows which job to read)
     *    - content:          inline string content */
    inputs?: InputSource[];
    /** L2: filenames the callee is expected to produce under _agim-output/.
     *  Missing files at return time become entries in `warnings`, not a
     *  hard failure — the callee is still allowed to do what it deems
     *  best. */
    expectOutputs?: string[];
}
export type CallAgentResult = {
    ok: true;
    result: string;
    jobId: number;
    agent: string;
    durationMs: number;
    /** L2: absolute path of the artifacts directory for this run. */
    artifactsDir: string;
    /** L2: files the callee left under _agim-output/. */
    outputs: OutputFile[];
    /** L2: non-fatal advisories — e.g. expectOutputs that didn't show up. */
    warnings?: string[];
} | {
    ok: false;
    error: string;
    jobId?: number;
    agent?: string;
};
/** Programmatic A2A entry. Invokes `agentName` with `prompt` under the
 *  given RouteContext. Does NOT touch session history, does NOT deliver
 *  to IM. Result is returned to the caller verbatim. */
export declare function callAgentByName(agentName: string, prompt: string, ctx: RouteContext, opts?: CallAgentOpts): Promise<CallAgentResult>;
//# sourceMappingURL=a2a.d.ts.map