export interface CurrentTurnProvenance { sessionId: string; turnId: string; callerOpenId: string; larkAppId: string; chatId: string; chatType?: 'group' | 'p2p'; /** * The current user-visible thread anchor. Thread sessions use their durable * root; a chat-scope turn folded into a topic uses that turn's reply target; * a chat-top-level turn deliberately has no root. */ rootMessageId?: string; } export declare class CurrentTurnProvenanceError extends Error { constructor(message: string); } export interface ResolveCurrentTurnProvenanceOptions { dataDir: string; /** Inherited session id is only a stale/detached detector, never identity. */ envSessionId?: string; startPid?: number; } /** * Authenticate an agent-facing command as the human who opened the *current* * botmux turn. * * Unlike the read/reply command resolver, this intentionally has no inherited * env fallback. A long-lived CLI keeps stale BOTMUX_TURN_ID/OWNER values, and a * detached child keeps those values after losing the process-tree link. A * mutating workflow command therefore requires the worker's fresh ancestor * marker (sessionId + turnId), then joins it to the latest durable session * record. Missing, detached and stale invocations fail closed. * * Returns null only for a genuine standalone/dev invocation: there is neither * an ancestor marker nor an inherited BOTMUX_SESSION_ID claim. */ export declare function resolveCurrentTurnProvenance(options: ResolveCurrentTurnProvenanceOptions): CurrentTurnProvenance | null; //# sourceMappingURL=current-turn-provenance.d.ts.map