import type { WebActionScope, WebApprovalDefault, WebCapabilityDescriptorContract, WebCapabilityFamily, WebCapabilityId, WebDegradationTarget, WebEscalationReason, WebExecutionMode, WebPolicyRiskClass, WebRetryPolicy, WebStatefulness, WebTaskMode, ToolRiskLevel } from "./web-capability.js";
import type { ApprovalRequiredToolContract } from "./session.js";
export declare const CAPABILITY_MANIFEST_DIFF_SECTIONS: readonly ["gatewayVersion", "toolNamespaces", "workspaceIds", "installedCapabilities", "enabledCapabilities", "features", "approvalMode", "toolManifests", "skillManifests", "pluginManifests", "mcpManifests", "approvalPolicy", "workspaceSummaries"];
export type CapabilityManifestDiffSection = (typeof CAPABILITY_MANIFEST_DIFF_SECTIONS)[number];
export type CapabilityManifestApprovalMode = "user-confirm" | "pre-authorized";
export type CapabilityToolManifestContract = WebCapabilityDescriptorContract & {
    name: string;
    label: string;
    description: string;
    source: "core" | "plugin";
    capabilityId?: WebCapabilityId;
    capabilityFamily?: WebCapabilityFamily;
    taskMode?: WebTaskMode;
    executionMode?: WebExecutionMode;
    statefulness?: WebStatefulness;
    approvalDefault?: WebApprovalDefault;
    policyRiskClass?: WebPolicyRiskClass;
    riskLevel?: ToolRiskLevel;
    allowedActionScopes?: WebActionScope[];
    degradationTarget?: WebDegradationTarget;
    upgradeTargets?: WebCapabilityId[];
    escalationReasons?: WebEscalationReason[];
    retryPolicy?: WebRetryPolicy;
    [key: string]: unknown;
};
export type CapabilitySkillManifestContract = {
    name: string;
    description: string;
    source: string;
    eligible: boolean;
    disabled: boolean;
    [key: string]: unknown;
};
export type CapabilityPluginManifestContract = {
    id: string;
    name: string;
    enabled: boolean;
    status: "loaded" | "disabled" | "error";
    [key: string]: unknown;
};
export type CapabilityMcpManifestContract = {
    id: string;
    name: string;
    enabled: boolean;
    status: "connected" | "disconnected" | "error";
    [key: string]: unknown;
};
export interface CapabilityManifestApprovalPolicyContract {
    mode: CapabilityManifestApprovalMode;
    execApprovalsConfigured: boolean;
}
export interface CapabilityWorkspaceSummaryContract {
    id: string;
    role?: string;
}
export interface CapabilityManifestSnapshotContract {
    snapshotVersion: string;
    updatedAt: string;
    syncMode?: "full" | "diff";
    baseSnapshotVersion?: string;
    changedSections?: CapabilityManifestDiffSection[];
    gatewayVersion?: string;
    toolNamespaces: string[];
    workspaceIds: string[];
    installedCapabilities?: string[];
    enabledCapabilities?: string[];
    features?: string[];
    approvalMode?: CapabilityManifestApprovalMode;
    toolManifests?: CapabilityToolManifestContract[];
    skillManifests?: CapabilitySkillManifestContract[];
    pluginManifests?: CapabilityPluginManifestContract[];
    mcpManifests?: CapabilityMcpManifestContract[];
    approvalPolicy?: CapabilityManifestApprovalPolicyContract;
    workspaceSummaries?: CapabilityWorkspaceSummaryContract[];
}
export interface HostCapabilitySnapshotContract extends CapabilityManifestSnapshotContract {
    installedCapabilities?: string[];
    enabledCapabilities?: string[];
}
export type ToolEligibilityStatus = "installed-disabled" | "installed-awaiting-approval" | "installed-ineligible-context" | "enabled-eligible" | "blocked-by-policy" | "unreachable-runtime";
export type ToolEligibilityReasonCode = "host_disabled" | "approval_required" | "policy_blocked" | "context_mismatch" | "runtime_unreachable" | "not_installed";
export type ToolEligibilityResolvedSource = "host-capability" | "plugin-manifest" | "mcp-manifest" | "policy" | "runtime-context";
export interface RuntimeToolEligibilityContract {
    toolName: string;
    status: ToolEligibilityStatus;
    approvalRequired: boolean;
    reasonCodes: ToolEligibilityReasonCode[];
    eligibilityReason?: ToolEligibilityReasonCode;
    policyBlocked?: boolean;
    contextEligible?: boolean;
    resolvedSource?: ToolEligibilityResolvedSource;
    hostLocalOnly?: boolean;
}
export interface RuntimeCapabilityViewContract {
    snapshotVersion: string;
    installedCapabilities: string[];
    enabledCapabilities: string[];
    eligibleTools: RuntimeToolEligibilityContract[];
    ineligibleTools: RuntimeToolEligibilityContract[];
    approvalRequiredTools?: ApprovalRequiredToolContract[];
}
export declare function cloneCapabilityManifestSnapshot<T extends CapabilityManifestSnapshotContract>(snapshot: T): T;
export declare function mergeCapabilityManifestSnapshot(params: {
    previous?: CapabilityManifestSnapshotContract | null;
    update: CapabilityManifestSnapshotContract;
}): CapabilityManifestSnapshotContract;
export declare function deriveCapabilityToolNamespaces(toolManifests: ReadonlyArray<Pick<CapabilityToolManifestContract, "name">>): string[];
export declare function deriveCapabilityWorkspaceIds(workspaceSummaries: ReadonlyArray<Pick<CapabilityWorkspaceSummaryContract, "id">>): string[];
export declare function createCapabilityManifestDiffPayload<T extends CapabilityManifestSnapshotContract>(params: {
    previous?: T | null;
    current: T;
}): T | null;
