import type { DaoCoreConfig } from "../config/types.daocore.js";
import { callGateway as defaultCallGateway } from "../gateway/call.js";
type GatewayCaller = typeof defaultCallGateway;
/** Test hook: must stay aligned with `sessions-resolution` `testing.setDepsForTest`. */
export declare const sessionVisibilityGatewayTesting: {
    setCallGatewayForListSpawned(overrides?: GatewayCaller): void;
};
export type SessionToolsVisibility = "self" | "tree" | "agent" | "all";
export type AgentToAgentPolicy = {
    enabled: boolean;
    matchesAllow: (agentId: string) => boolean;
    isAllowed: (requesterAgentId: string, targetAgentId: string) => boolean;
};
export type SessionAccessAction = "history" | "send" | "list" | "status";
export type SessionAccessResult = {
    allowed: true;
} | {
    allowed: false;
    error: string;
    status: "forbidden";
};
export type SessionVisibilityRow = {
    key: string;
    agentId?: string;
    ownerSessionKey?: string;
    spawnedBy?: string;
    parentSessionKey?: string;
};
export declare function listSpawnedSessionKeys(params: {
    requesterSessionKey: string;
    limit?: number;
}): Promise<Set<string>>;
export declare function resolveSessionToolsVisibility(cfg: DaoCoreConfig): SessionToolsVisibility;
export declare function resolveEffectiveSessionToolsVisibility(params: {
    cfg: DaoCoreConfig;
    sandboxed: boolean;
}): SessionToolsVisibility;
export declare function resolveSandboxSessionToolsVisibility(cfg: DaoCoreConfig): "spawned" | "all";
export declare function createAgentToAgentPolicy(cfg: DaoCoreConfig): AgentToAgentPolicy;
export declare function createSessionVisibilityChecker(params: {
    action: SessionAccessAction;
    requesterSessionKey: string;
    visibility: SessionToolsVisibility;
    a2aPolicy: AgentToAgentPolicy;
    spawnedKeys: Set<string> | null;
}): {
    check: (targetSessionKey: string) => SessionAccessResult;
};
export declare function createSessionVisibilityRowChecker(params: {
    action: SessionAccessAction;
    requesterSessionKey: string;
    visibility: SessionToolsVisibility;
    a2aPolicy: AgentToAgentPolicy;
}): {
    check: (row: SessionVisibilityRow) => SessionAccessResult;
};
export declare function createSessionVisibilityGuard(params: {
    action: SessionAccessAction;
    requesterSessionKey: string;
    visibility: SessionToolsVisibility;
    a2aPolicy: AgentToAgentPolicy;
}): Promise<{
    check: (targetSessionKey: string) => SessionAccessResult;
}>;
export {};
