import { type McpToolResult } from "../../_shared/baseToolAdapter.js";
export type McpSubscribePermission = "mcp:subscription:write";
export type McpSubscribeSubjectType = "resource" | "event" | "tool";
export type McpSubscribeReplayPolicy = "none" | "latest";
export type McpSubscribeContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    contract?: {
        accepted?: boolean;
        reason?: string;
    };
    governance?: {
        accepted?: boolean;
        reason?: string;
    };
    allowedServerIds?: readonly string[];
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    grantedPermissions?: readonly McpSubscribePermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpSubscribeTarget = {
    serverId: string;
    connectionId?: string;
    subjectType: McpSubscribeSubjectType;
    subject: string;
    eventKinds?: readonly string[];
    replayPolicy: McpSubscribeReplayPolicy;
};
export type McpSubscribeProviderRequest = McpSubscribeTarget;
export type McpSubscribeRequest = {
    target?: Partial<McpSubscribeTarget> | null;
    context?: McpSubscribeContext;
};
export type McpSubscriptionEnvelope = {
    subscriptionId: string;
    serverId: string;
    connectionId?: string;
    subjectType: McpSubscribeSubjectType;
    subject: string;
    eventKinds: readonly string[];
    replayPolicy: McpSubscribeReplayPolicy;
    state: "planned" | "subscribed" | "already_subscribed" | "pending";
    status?: string;
};
export type McpSubscribeProviderResult = {
    subscriptionId: string;
    status: "subscribed" | "already_subscribed" | "pending";
    serverId?: string;
    connectionId?: string;
    providerMetadata?: Readonly<Record<string, unknown>>;
    raw?: unknown;
};
export type McpSubscribeProvider = (request: McpSubscribeProviderRequest, context: Readonly<Record<string, unknown>>) => Promise<McpSubscribeProviderResult> | McpSubscribeProviderResult;
export type McpSubscribeOutput = {
    kind: "agentCore.basicTool.mcp.subscribe";
    target: McpSubscribeTarget;
    subscriptionEnvelope: McpSubscriptionEnvelope;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    permissionsRequired: readonly McpSubscribePermission[];
    unsafeSideEffects: true;
    acceptedScopes: readonly string[];
    providerMetadata?: Readonly<Record<string, unknown>>;
};
export type McpSubscribeErrorCode = "INVALID_REQUEST" | "INVALID_CONTEXT" | "MISSING_SERVER_ID" | "INVALID_SERVER_ID" | "INVALID_CONNECTION_ID" | "MISSING_SUBJECT_TYPE" | "INVALID_SUBJECT_TYPE" | "MISSING_SUBJECT" | "INVALID_SUBJECT" | "INVALID_EVENT_KINDS" | "INVALID_REPLAY_POLICY" | "SCOPE_DENIED" | "PERMISSION_DENIED" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "REAL_EXECUTION_BLOCKED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type McpSubscribeResult = McpToolResult<McpSubscribeOutput, McpSubscribeErrorCode>;
export declare const mcpSubscribeDescriptor: {
    readonly toolId: "mcp.subscribe";
    readonly capability: "subscribe-mcp-events-or-resources";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.mcpBase.subscription";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly permissionsRequired: readonly ["mcp:subscription:write"];
    readonly unsafeSideEffects: true;
};
export declare function planMcpSubscribe(request?: unknown): McpSubscribeResult;
export declare function executeMcpSubscribe(request?: unknown, provider?: McpSubscribeProvider): Promise<McpSubscribeResult>;
