import { i as OpenClawConfig } from "./types.openclaw-DmcB4-gw.js";
import { t as callGateway } from "./call-C-C89FAp.js";

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