import { type SubagentParentContext } from "#subagents/invocation.js";
import type { ActivityObserverConfig, ChannelInstrumentationProjection, SessionAuthContext, SessionCapabilities, RunInput } from "#channel/types.js";
import type { HarnessSession } from "#harness/types.js";
import type { RuntimeSubagentDispatchRequest } from "#shared/action-types.js";
import type { JsonObject } from "#shared/json.js";
export type SubagentInputSource = {
    readonly description: string;
    readonly outputSchema?: JsonObject;
    readonly type: "local";
} | {
    readonly outputSchema?: JsonObject;
    readonly type: "runtime";
};
/**
 * Result of {@link buildSubagentRunInput}.
 *
 * Exposes the derived `childContinuationToken` alongside the
 * {@link RunInput} so dispatch sites never re-derive the token from
 * `(callId, parentSessionId)` on their own.
 */
export interface SubagentRunInputBuild {
    readonly childContinuationToken: string;
    readonly runInput: RunInput;
}
/**
 * Runtime graph shape needed to answer sandbox-inheritance questions for
 * one declared child node. Partial test bundles may omit the graph.
 */
export interface SubagentSandboxGraph {
    readonly nodesByNodeId: ReadonlyMap<string, {
        readonly sandboxRegistry: {
            readonly sandbox: {
                readonly definition: {
                    readonly inheritsParent?: boolean;
                };
            } | null;
        };
    }>;
}
/**
 * Builds the {@link RunInput} for one delegated subagent child run.
 */
export declare function buildSubagentRunInput(input: {
    readonly action: RuntimeSubagentDispatchRequest;
    readonly auth: SessionAuthContext | null;
    /**
     * Parent's session capabilities. Forwarded verbatim so HITL
     * readiness flows transparently down through a subagent chain. Undefined
     * parent capabilities produce an undefined child capability set.
     */
    readonly capabilities?: SessionCapabilities;
    readonly channelMetadata?: ChannelInstrumentationProjection;
    /**
     * Number of local subagent calls dispatched in this batch. The parent's
     * remaining token quota is split evenly across them so parallel children
     * are collectively, not individually, bounded by it. Remote agents run
     * under their own deployment's limits and are not counted.
     */
    readonly fanoutSize?: number;
    readonly initiatorAuth: SessionAuthContext | null;
    /**
     * Runtime graph used to detect whether this declared child selected the
     * dispatching parent's sandbox. Absence means no inheritance.
     */
    readonly graph?: SubagentSandboxGraph;
    /** Durable session identity of the sandbox currently used by the parent. */
    readonly sandboxSessionId?: string;
    readonly selfAgent: boolean;
    readonly parent: SubagentParentContext;
    readonly activityObserver?: ActivityObserverConfig;
    readonly session: HarnessSession;
    readonly source: SubagentInputSource;
    /** Owning task when this child starts from a background workflow tool. */
    readonly taskId?: string;
}): SubagentRunInputBuild;
