/**
 * 问题三十九: Extension Contract — 扩展生命周期、权限授权与审计。
 *
 * 强制执行:
 * - 第三方扩展不得自称 enforced
 * - 扩展权限必须显式授权、最小权限、可撤销
 * - 扩展不能绕过 Contract Registry / Guard / Language Policy
 */
import type { ExtensionManifest, ExtensionGrant, ExtensionAuditReport, ExtensionCapabilityDeclaration, ExtensionPermission, ExtensionLifecycleStatus } from "./extension_platform_contracts.js";
export interface ExtensionValidationResult {
    valid: boolean;
    violations: string[];
    warnings: string[];
}
export interface ExtensionLifecycleResult {
    allowed: boolean;
    from_status: ExtensionLifecycleStatus;
    to_status: ExtensionLifecycleStatus;
    reason: string;
}
/**
 * 创建默认扩展清单。
 */
export declare function createExtensionManifest(overrides: Partial<ExtensionManifest> & Pick<ExtensionManifest, "extension_id">): ExtensionManifest;
/**
 * 验证扩展清单。
 * - 第三方扩展不得使用 enforced 状态
 * - 权限必须在白名单内
 * - 必须声明 contract_ids 和 capability_ids
 */
export declare function validateExtensionManifest(manifest: ExtensionManifest, declaredCapabilities: ExtensionCapabilityDeclaration): ExtensionValidationResult;
/**
 * 评估扩展生命周期转移是否合法。
 */
export declare function evaluateExtensionLifecycle(_extensionId: string, fromStatus: ExtensionLifecycleStatus, toStatus: ExtensionLifecycleStatus): ExtensionLifecycleResult;
/**
 * 授权扩展权限。
 * - 高风险权限需要 human approval
 * - 权限必须是最小集
 */
export declare function grantExtensionPermissions(extensionId: string, requestedPermissions: ExtensionPermission[], grantedBy: string, purpose: string, humanApproved: boolean): ExtensionGrant;
/**
 * 撤销扩展权限授权。
 */
export declare function revokeExtensionGrant(grant: ExtensionGrant, _reason: string): ExtensionGrant;
/**
 * 生成扩展审计报告。
 */
export declare function auditExtension(manifest: ExtensionManifest, grant: ExtensionGrant, capabilityDecl: ExtensionCapabilityDeclaration): ExtensionAuditReport;
//# sourceMappingURL=extension_contract.d.ts.map