import type { HookEventEnvelope, HookEventName } from "../../hooks/extensibility/types.js"; import { type HerdrRollupInput, type HerdrSemanticState } from "./semantic.js"; import { type HerdrEnv, type HerdrTransport, type HerdrTransportResult } from "./transport.js"; export declare const HERDR_BRIDGE_SOURCE = "omx:runtime"; export declare const HERDR_BRIDGE_AGENT = "codex"; export interface HerdrBridgeOptions { env?: HerdrEnv; transport?: HerdrTransport; source?: string; agent?: string; /** Injectable seq provider; defaults to the durable cross-process store. */ seqFn?: (source: string) => number; /** Base dir for the durable seq/authority stores (tests). */ stateBaseDir?: string; /** * Returns true when an OMX workflow other than this one remains active, so * release must be suppressed. Defaults to "nothing else active". */ workflowActiveFn?: () => boolean; /** Best-effort logger; never throws into the OMX run. */ logger?: (message: string, meta?: Record) => void; /** Session id recorded on the authority record for crash reconciliation. */ sessionId?: string; } export interface HerdrBridgeOutcome { attempted: boolean; ok: boolean; skipped: boolean; reason: string; state?: HerdrSemanticState; seq?: number; released?: boolean; transport?: HerdrTransportResult; } /** * Opt-in, best-effort OMX -> Herdr lifecycle/status bridge. * * - No behavior change outside a detected Herdr pane. * - Ordered: seq comes from a durable cross-process per-source store, so stale * reports cannot win across concurrent hook processes or restarts. * - Non-blocking / failure-isolated: transport errors are captured and returned, * never thrown. * - Release is gated on remaining active workflows and records/clears authority * for crash reconciliation. */ export declare class HerdrBridge { private readonly env; private readonly transport; private readonly source; private readonly agent; private readonly seqFn; private readonly workflowActiveFn; private readonly stateBaseDir?; private readonly sessionId?; private readonly logger?; private released; private authorityRecorded; constructor(options?: HerdrBridgeOptions); get enabled(): boolean; private nextSeq; private skip; reportState(state: HerdrSemanticState, options?: { message?: string; metadata?: Record; }): Promise; reportHookEvent(event: HookEventEnvelope | HookEventName | string, options?: { message?: string; metadata?: Record; }): Promise; reportTeamRollup(input: HerdrRollupInput, options?: { metadata?: Record; }): Promise; /** * Release `omx:runtime` authority. Suppressed while another OMX workflow * remains active (a single terminal event must not release authority for * still-running workflows). Clears the authority record on release. */ release(): Promise; private ensureAuthorityRecorded; private clearAuthorityRecord; private log; } export declare function createHerdrBridge(options?: HerdrBridgeOptions): HerdrBridge; //# sourceMappingURL=bridge.d.ts.map