/** * @license * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 */ import { readLiveSessionRecords, sendPeerFrame, startPeerInbox, type PeerSessionSummary } from '../vendor/qwen-code-peer/index.js'; import type { BackendHandle, InstructionDelivery, InstructionReceipt } from './types.js'; export interface QwenPeerControllerDependencies { /** Test seams only; normal operation uses the pinned SDK's Node helpers. */ readRecords?: typeof readLiveSessionRecords; startInbox?: typeof startPeerInbox; sendFrame?: typeof sendPeerFrame; receiptTimeoutMs?: number; } interface ControllerOptions { qwenHome: string; adaptor: string; name: string; controllerToken: string; isActive: () => boolean; onChange: () => void; } /** Identity is scoped to the home and the process incarnation, never a label. */ export declare function qwenPeerHandleId(qwenHome: string, peer: Pick): string; /** * Fixed-socket controller delivery, separate from the discovery SDK endpoint. * PeerEndpoint.send resolves names again and cannot pin the selected record; * its private receipt ledger also cannot track frames sent by this transport. * The extra inbox receives receipts only and is not published in the registry. */ export declare class QwenPeerController { private readonly options; private readonly records; private readonly replyToken; private inbox?; private closed; private exitHook?; private readonly readRecords; private readonly openInbox; private readonly sendFrame; private readonly receiptTimeoutMs; constructor(options: ControllerOptions, dependencies?: QwenPeerControllerDependencies); start(): Promise; deliveries(): InstructionDelivery[]; send(handle: BackendHandle, content: string): Promise; close(): Promise; private active; private receive; private settle; private finish; private update; private makeRoom; private snapshot; private notify; } export {};