import type { Session, VcMeetingImTurnOrigin, VcMeetingListenerOutputPlacement } from '../types.js'; import type { VcMeetingListenerOutputProtocol } from './vc-meeting-listener-output-protocol.js'; /** Resolve explicit-IM authority by the worker's live turn id. The latest * quote target is presentation state only: message B may already be queued * while message A is still the live CLI turn. */ export declare function resolveVcMeetingImTurnOrigin(session: Pick | undefined, turnId: string | undefined): VcMeetingImTurnOrigin | undefined; export interface VcMeetingManagedSendOrigin { receiverSessionId: string; turnId?: string; dispatchAttempt?: number; receiverSession: boolean; /** Persisted authority snapshot for the current explicit human IM turn. * This is the trusted no-dispatchAttempt origin; callers must not populate it * from the CLI's static spawn environment. */ currentImTurnOrigin?: VcMeetingImTurnOrigin; /** Worker UI may need to patch/freeze an already-created card after terminal; * new botmux send/ask effects must leave this false. */ allowTerminalReceipt?: boolean; /** In-meeting managed output (request-output → managed-action) is a DIFFERENT * channel from listener-group auto-post. `responseMode: silent` governs only * whether the agent auto-posts to the listener group; it must NOT gate * in-meeting speech, which is authorized downstream at the hub by * capability + textOutputPolicy/voiceOutputPolicy (see vc-meeting-action-gate). * Set true ONLY on the in-meeting-output authorization path so this evaluator * still proves receipt identity/liveness (existence, attempt match, active * projection, dispatched/completed status) but skips the silent veto. Listener * auto-post callers (final_output / botmux send) leave it false so silent keeps * suppressing group posts. */ forInMeetingOutput?: boolean; } export type VcMeetingManagedSendDecision = { ok: true; kind: 'ordinary'; } | { ok: true; kind: 'listener_thread'; /** Durable ownership used to index the successful primary Lark output. */ meetingOwner: { listenerAppId: string; meetingId: string; memberId: string; memberEpoch: number; }; /** Automatic delivery placement. Explicit human IM turns remain routed * to their quote/thread context and therefore use `auto`. */ outputPlacement: VcMeetingListenerOutputPlacement; listenerOutputProtocol: VcMeetingListenerOutputProtocol; } | { ok: false; errorCode: 'origin_unproven' | 'receipt_not_found' | 'origin_mismatch' | 'silent_delivery'; error: string; }; export interface VcMeetingLiveManagedOrigin { capability: string; turnId?: string; dispatchAttempt?: number; } export type VcMeetingManagedOriginVerification = { ok: true; origin: { receiverSessionId: string; turnId?: string; dispatchAttempt?: number; currentImTurnId?: string; currentImTurnOrigin?: VcMeetingImTurnOrigin; }; } | Extract; export declare function isTrustedVcMeetingHostRelayParent(markerPresent: boolean, sessionWorkerPid: number | null | undefined, parentPid: number): boolean; /** Authorize a daemon-mediated exit (ask/action relay) against the worker's * live origin registry. Only the rotating capability proves authority; the * visible turn tuple is routing/diagnostic context and is never a credential. */ export declare function evaluateVcMeetingManagedOriginClaim(dataDir: string, input: { receiverSessionId: string; currentImTurnOrigin?: VcMeetingImTurnOrigin; liveOrigin?: VcMeetingLiveManagedOrigin; claimedCapability?: string; claimedTurnId?: string; claimedDispatchAttempt?: number; }): VcMeetingManagedSendDecision; /** * Prove that a daemon-mediated request belongs to the worker's current turn, * without imposing a particular sink policy. `botmux send`/ask call the * evaluator above (which also enforces responseMode); the deterministic action * gate calls this verifier and then applies capability/sink-owner policy at the * hub. Keeping these concerns separate prevents `silent` from becoming either * an action bypass or an accidental blanket capability model. */ export declare function verifyVcMeetingManagedOriginClaim(input: { receiverSessionId: string; currentImTurnOrigin?: VcMeetingImTurnOrigin; liveOrigin?: VcMeetingLiveManagedOrigin; claimedCapability?: string; claimedTurnId?: string; claimedDispatchAttempt?: number; }): VcMeetingManagedOriginVerification; /** An IM turn snapshot is authority only while the exact member epoch and all * ownership fences are still the current active projection. Explicit human * turns ignore responseMode, but they never outlive pause/remove/reassignment * or an owner-generation change. */ export declare function isCurrentVcMeetingImTurnOrigin(dataDir: string, origin: VcMeetingImTurnOrigin | undefined, expectedTargetChatId?: string): origin is VcMeetingImTurnOrigin; /** Resolve a managed output decision from the durable receipt, not mutable * process-global "current turn" state. Missing origin evidence on a dedicated * receiver fails closed; ordinary sessions stay unchanged. * * Plan B: the receiver marker (`vcMeetingReceiver`) is pure metadata — a * stamped session whose projection never activated (registration failed) or * was removed/paused is effectively an ordinary chat-scope session. Only an * ACTIVE projection keeps the receiver fenced to attributable origins; with * none, the session falls back to `ordinary` so it is not bricked by the * managed-output gate (e.g. a Pi adapter that cannot claim * `reliableTurnTerminal` leaves the auto-start session stamped but unable to * reply to any human message). */ export declare function evaluateVcMeetingManagedSend(dataDir: string, origin: VcMeetingManagedSendOrigin): VcMeetingManagedSendDecision; //# sourceMappingURL=vc-meeting-send-policy.d.ts.map