import type { ProxyKeySource } from "./transport.js";
import type { MemoryContextBlock } from "./memory-provider-lifecycle.js";
import type { WebCapabilityFamily, WebTaskMode, WebExecutionMode, WebStatefulness, WebPolicyRiskClass, ToolRiskLevel } from "./web-capability.js";
export interface TransportCapabilitySummaryContract {
    snapshotVersion: string;
    installedCapabilities: string[];
    enabledCapabilities: string[];
    eligibleToolCount?: number;
    ineligibleToolCount?: number;
}
export interface TransportApprovalRequiredToolHintEntry {
    toolName: string;
    reasonCodes?: string[];
}
export interface TransportToolEligibilitySummaryEntry {
    toolName: string;
    status: string;
    approvalRequired: boolean;
    reasonCodes?: string[];
    eligibilityReason?: string;
    policyBlocked?: boolean;
    contextEligible?: boolean;
    resolvedSource?: string;
}
export interface CapabilityInstallStateSummary {
    installedCapabilities: string[];
    enabledCapabilities: string[];
}
export interface CapabilityPolicyHintEntry {
    code: string;
    scope?: string;
    message?: string;
}
export interface AgentTurnRequestSpec {
    modality?: "text" | "image" | "video" | "audio" | "music";
    params?: Record<string, unknown>;
}
export interface AgentTurnLocalContext {
    capabilitySnapshotVersion?: string;
    toolNamespaces?: string[];
    workspaceIds?: string[];
    capabilitySummary?: TransportCapabilitySummaryContract;
    approvalRequiredToolHint?: TransportApprovalRequiredToolHintEntry[];
    eligibleToolSummary?: TransportToolEligibilitySummaryEntry[];
    ineligibleToolSummary?: TransportToolEligibilitySummaryEntry[];
    memoryContextBlocks?: MemoryContextBlock[];
}
export interface AgentTurnClientHints {
    uiSurface?: string;
    locale?: string;
}
export interface AgentTurnAttachment {
    id?: string;
    type?: string;
    mimeType?: string;
    url?: string;
    name?: string;
}
export interface AgentTurnConversation {
    messages: unknown[];
    attachments?: AgentTurnAttachment[];
    summary?: string;
}
export interface AgentTurnExperience {
    mode?: string;
    modelAlias?: string;
    stream?: boolean;
    responseFormat?: string;
    keySource?: ProxyKeySource;
}
export interface ToolExecutionStepContext {
    stepIndex?: number;
    stepTotal?: number;
    stepSummary?: string;
    selectedCapabilityId?: string;
    selectedCapabilityFamily?: WebCapabilityFamily;
    selectedTaskMode?: WebTaskMode;
    displayRiskLabel?: string;
    displayFallbackLabel?: string;
    displayBlockedLabel?: string;
    decisionReasonCode?: string;
    fallbackPlanRef?: string;
}
export interface ToolInvokeApprovalDescriptor extends ToolExecutionStepContext {
    mode?: "user-confirm" | "pre-authorized";
    reason?: string;
}
export interface CapabilityToolManifestEntry {
    name: string;
    label: string;
    description: string;
    source: "core" | "plugin";
    category?: "core" | "media" | "browser" | "session" | "system" | "think";
    groupId?: string;
    pluginId?: string;
    optional?: boolean;
    defaultProfiles?: string[];
    requiredParameters?: string[];
    parametersSummary?: string;
    riskLevel?: ToolRiskLevel;
    approvalMode?: "user-confirm" | "pre-authorized";
    requiresApproval?: boolean;
    parallelSafe?: boolean;
    serialOnly?: boolean;
    recoverable?: boolean;
    resultMode?: "final";
    capabilityId?: string;
    capabilityFamily?: WebCapabilityFamily;
    taskMode?: WebTaskMode;
    executionMode?: WebExecutionMode;
    statefulness?: WebStatefulness;
    approvalDefault?: "required" | "conditional" | "none";
    policyRiskClass?: WebPolicyRiskClass;
    requiresRuntimeBackend?: boolean;
    requiresHostBridge?: boolean;
    supportsRenderBackend?: boolean;
    supportsLoginState?: boolean;
    supportsPersistentProfile?: boolean;
    supportsSharedSessionReuse?: boolean;
    supportsTransactionality?: "read-only" | "state-changing";
    allowedActionScopes?: string[];
    degradationTarget?: string;
    upgradeTargets?: string[];
    fallbackChain?: string[];
    escalationReasons?: string[];
    auditRequired?: boolean;
    requiresUserVisibleStep?: boolean;
    retryPolicy?: "none" | "same-capability-once" | "degrade-only";
    repairAfterDenied?: boolean;
    repairAfterUnavailable?: boolean;
    displayRiskLabel?: string;
    displayBlockedLabel?: string;
    displayFallbackLabel?: string;
}
export interface CapabilitySkillManifestEntry {
    name: string;
    description: string;
    source: string;
    eligible: boolean;
    disabled: boolean;
    category?: string;
    installable?: boolean;
}
export interface CapabilityPluginManifestEntry {
    id: string;
    name: string;
    version?: string;
    description?: string;
    kind?: string;
    origin?: string;
    enabled: boolean;
    status: "loaded" | "disabled" | "error";
    error?: string;
    hasConfigSchema?: boolean;
    capabilityFlags?: string[];
}
export interface CapabilityMcpManifestEntry {
    id: string;
    name: string;
    enabled: boolean;
    status: "connected" | "disconnected" | "error";
    serverKind?: string;
    tools?: string[];
}
export interface CapabilityApprovalPolicy {
    mode: "user-confirm" | "pre-authorized";
    execApprovalsConfigured: boolean;
}
export interface CapabilityWorkspaceSummary {
    id: string;
    role?: string;
}
export interface CapabilitySyncPayload {
    snapshotVersion: string;
    updatedAt: string;
    syncMode?: "full" | "diff";
    baseSnapshotVersion?: string;
    changedSections?: string[];
    gatewayVersion?: string;
    toolNamespaces: string[];
    workspaceIds: string[];
    installedCapabilities?: string[];
    enabledCapabilities?: string[];
    features?: string[];
    approvalMode?: "user-confirm" | "pre-authorized";
    toolManifests?: CapabilityToolManifestEntry[];
    skillManifests?: CapabilitySkillManifestEntry[];
    pluginManifests?: CapabilityPluginManifestEntry[];
    mcpManifests?: CapabilityMcpManifestEntry[];
    approvalPolicy?: CapabilityApprovalPolicy;
    policyHints?: CapabilityPolicyHintEntry[];
    workspaceSummaries?: CapabilityWorkspaceSummary[];
}
export interface CapabilitySyncMsg extends CapabilitySyncPayload {
    type: "capability.sync";
    id: string;
}
export interface CapabilitySyncAckPayload {
    success: true;
    snapshotVersion: string;
    receivedAt: string;
}
export interface CapabilitySyncAckMsg {
    type: "capability.sync.ack";
    id: string;
    payload: CapabilitySyncAckPayload;
}
