export interface SecureChannelConfig {
    inviteToken: string;
    dataDir: string;
    apiUrl: string;
    agentName?: string;
    agentVersion?: string;
    platform?: string;
    maxHistorySize?: number;
    webhookUrl?: string;
    httpPort?: number;
    onMessage?: (plaintext: string, metadata: MessageMetadata) => void;
    onStateChange?: (state: ChannelState) => void;
    onA2AMessage?: (msg: A2AMessage) => void;
    /** Called when an A2A channel becomes ready (approved or activated). */
    onA2AChannelReady?: (info: {
        channelId: string;
        peerHubAddress: string;
        role: "initiator" | "responder";
        conversationId: string;
        topic?: string;
    }) => void;
    /** Enable client-side policy scanning. If true, rules are fetched on connect. */
    enableScanning?: boolean;
    /** If set, auto-backup encrypted state to server after state changes. */
    backupCode?: string;
}
export type ChannelState = "idle" | "enrolling" | "polling" | "activating" | "connecting" | "ready" | "disconnected" | "error";
export interface AttachmentData {
    filename: string;
    mime: string;
    size: number;
    filePath: string;
    /** Base64-encoded decrypted content (for images passed to LLM vision) */
    base64?: string;
    /** Extracted text content (for text-based files) */
    textContent?: string;
}
export interface MessageMetadata {
    messageId: string;
    conversationId: string;
    timestamp: string;
    topicId?: string;
    attachment?: AttachmentData;
    spanId?: string;
    parentSpanId?: string;
    messageType?: string;
    priority?: string;
    envelopeVersion?: string;
    /** Set when the message originated from a multi-agent room */
    roomId?: string;
    /** Device ID of the sender (room messages only) */
    senderDeviceId?: string;
    /** Human-readable room name (room messages only) */
    roomName?: string;
}
export interface SendOptions {
    /** Target a specific conversation instead of broadcasting to all sessions */
    conversationId?: string;
    topicId?: string;
    messageType?: string;
    priority?: string;
    parentSpanId?: string;
    metadata?: Record<string, unknown>;
}
export interface DecisionOption {
    option_id: string;
    label: string;
    risk_level: "low" | "medium" | "high" | "critical";
    is_default?: boolean;
}
export interface ContextRef {
    type: string;
    uri: string;
    label: string;
}
export interface DecisionRequest {
    title: string;
    description?: string;
    options: DecisionOption[];
    context_refs?: ContextRef[];
    deadline?: string;
    auto_action?: {
        option_id: string;
        trigger: string;
        description?: string;
    };
}
export interface DecisionResponse {
    decision_id: string;
    selected_option_id?: string;
    resolved_at?: string;
    action?: "approve" | "deny" | "defer";
    defer_until?: string;
    defer_reason?: string;
}
export interface HistoryEntry {
    sender: "owner" | "agent";
    text: string;
    ts: string;
    topicId?: string;
}
export interface DeviceSession {
    ownerDeviceId: string;
    ratchetState: string;
    activated?: boolean;
}
export interface PersistedState {
    deviceId: string;
    deviceJwt: string;
    primaryConversationId: string;
    sessions: Record<string, DeviceSession>;
    identityKeypair: {
        publicKey: string;
        privateKey: string;
    };
    ephemeralKeypair: {
        publicKey: string;
        privateKey: string;
    };
    fingerprint: string;
    lastMessageTimestamp?: string;
    messageHistory?: HistoryEntry[];
    topics?: Array<{
        id: string;
        name: string;
        isDefault: boolean;
    }>;
    defaultTopicId?: string;
    groupId?: string;
    hubAddress?: string;
    hubId?: string;
    agentHubId?: string;
    agentRole?: "lead" | "peer";
    ownerHubId?: string;
    /** A2A channel state (agent-to-agent communication) */
    a2aChannels?: Record<string, {
        channelId: string;
        hubAddress: string;
        conversationId: string;
        role?: "initiator" | "responder";
        session?: DeviceSession;
        pendingEphemeralPrivateKey?: string;
        /** Observer session (agent → owner ratchet for A2A observation) */
        observerSession?: {
            ratchetState: string;
        };
        pendingObserverEphemeralPrivateKey?: string;
    }>;
    /** Outbound messages queued while disconnected */
    outboundQueue?: Array<{
        convId: string;
        headerBlob: string;
        ciphertext: string;
        messageGroupId: string;
        topicId?: string;
    }>;
    /** Multi-agent room state */
    rooms?: Record<string, RoomState>;
    /** Last inbound room ID for sticky room routing across restarts */
    lastInboundRoomId?: string;
    /** Shadow mode skill configurations (synced from backend via WS) */
    shadowSkills?: Record<string, {
        sessionId: string;
        autonomyLevel: "shadow" | "supervised" | "autonomous";
        decisionClass: string;
    }>;
}
/** Legacy state format for backward compatibility */
export interface LegacyPersistedState {
    deviceId: string;
    deviceJwt: string;
    conversationId: string;
    identityKeypair: {
        publicKey: string;
        privateKey: string;
    };
    ephemeralKeypair: {
        publicKey: string;
        privateKey: string;
    };
    fingerprint: string;
    ratchetState: string;
    lastMessageTimestamp?: string;
}
export interface RoomMemberInfo {
    deviceId: string;
    entityType: string;
    displayName: string;
    identityPublicKey?: string;
    ephemeralPublicKey?: string;
}
export interface RoomConversationInfo {
    id: string;
    participantA: string;
    participantB: string;
}
export interface RoomInfo {
    roomId: string;
    name: string;
    members: RoomMemberInfo[];
    conversationIds: string[];
}
export interface RoomState {
    roomId: string;
    name: string;
    conversationIds: string[];
    members: RoomMemberInfo[];
    /** Encryption mode — null/undefined = pairwise, "sender_key" = O(1) Sender Key */
    encryptionMode?: "pairwise" | "sender_key";
    /** Serialized SenderKeyChain (own chain for this room) */
    ownSenderKeyChain?: string;
    /** Serialized SenderKeyState (peer chains for this room) */
    peerSenderKeyState?: string;
    /** Set of device IDs we've distributed our sender key to */
    distributedTo?: string[];
}
export interface HeartbeatStatus {
    agent_status: string;
    current_task: string;
}
export interface StatusAlert {
    title: string;
    message: string;
    severity: "info" | "warning" | "error" | "critical";
    detail?: string;
    detailFormat?: "markdown" | "json" | "text";
    category?: "performance" | "security" | "error" | "info";
}
export interface RoomParticipantEvent {
    roomId: string;
    participant: {
        deviceId: string;
        participantType: "human" | "agent";
        displayName?: string;
    };
}
export interface A2AChannel {
    channelId: string;
    initiatorHubAddress: string;
    responderHubAddress: string;
    conversationId: string | null;
    status: "pending" | "approved" | "active" | "rejected" | "revoked";
    createdAt: string;
}
export interface A2AMessage {
    text: string;
    fromHubAddress: string;
    channelId: string;
    conversationId: string;
    parentSpanId?: string;
    timestamp: string;
}
/** Explicit routing target for outbound messages. */
export type DeliveryTarget = {
    kind: "owner";
} | {
    kind: "room";
    roomId: string;
} | {
    kind: "a2a";
    hubAddress: string;
} | {
    kind: "context";
};
export interface ShadowRecommendation {
    sessionId: string;
    skillName: string;
    decisionClass: string;
    recommendedAction: string;
    reasoningTrace?: string;
    observationId: string;
}
/** Structured message content for the deliver() dispatcher. */
export type DeliveryContent = {
    type: "text";
    text: string;
} | {
    type: "decision_request";
    request: DecisionRequest;
} | {
    type: "status_alert";
    alert: StatusAlert;
} | {
    type: "action_confirmation";
    confirmation: ActionConfirmation;
} | {
    type: "artifact";
    artifact: ArtifactPayload;
} | {
    type: "attachment";
    text: string;
    filePath: string;
} | {
    type: "policy_alert";
    alert: PolicyAlert;
} | {
    type: "approval_request";
    request: ApprovalRequest;
} | {
    type: "approval_response";
    response: ApprovalResponse;
} | {
    type: "shadow_recommendation";
    recommendation: ShadowRecommendation;
};
export interface ActionConfirmation {
    action: string;
    status: "completed" | "failed" | "partial";
    decisionId?: string;
    detail?: string;
    estimated_cost?: number;
}
export interface ArtifactPayload {
    filePath: string;
    filename: string;
    mimeType: string;
    description?: string;
}
/** Notify agent owner of a policy violation. */
export interface PolicyAlert {
    ruleId: string;
    scope: "tool" | "model" | "rate" | "network" | "custom";
    action: "block" | "warn" | "log";
    violationType: string;
    message: string;
    skillName?: string;
    toolName?: string;
    model?: string;
    timestamp?: string;
}
/** Human-in-the-loop gate for sensitive operations. */
export interface ApprovalRequest {
    approvalId: string;
    category: string;
    title: string;
    description: string;
    details?: Record<string, unknown>;
    expiresAt?: string;
    requiredTier?: string;
}
/** Owner response to an approval request. */
export interface ApprovalResponse {
    approvalId: string;
    approved: boolean;
    reason?: string;
    conditions?: string[];
    signature?: string;
}
export interface DeliveryOptions {
    conversationId?: string;
    topicId?: string;
    priority?: string;
    parentSpanId?: string;
    metadata?: Record<string, unknown>;
}
export interface DeliveryReceipt {
    ok: boolean;
    destination: {
        kind: "owner" | "room" | "a2a";
        id?: string;
    };
    error?: string;
    queued?: boolean;
    decisionId?: string;
    timestamp: string;
}
export interface TargetInfo {
    kind: "owner" | "room" | "a2a";
    id: string;
    label: string;
    available: boolean;
}
/**
 * Parse a string target into a DeliveryTarget.
 * Handles: "owner", "default", "room:<uuid>", "a2a:<hubAddr>", "context",
 * "agentvault:room:<uuid>" (channel-prefixed), "agent:<name>" (→ a2a).
 */
export declare function parseTarget(raw: string): DeliveryTarget;
//# sourceMappingURL=types.d.ts.map