export type SignalKind = 'finding' | 'blocker' | 'handoff' | 'budget-alert'; export declare const SIGNAL_KINDS: SignalKind[]; /** The typed inter-loop signal (LP-10 schema). */ export interface LoopSignal { id: string; /** Loop that emitted the signal — "/" by convention (loops.ts ids). */ sourceLoop: string; /** Routing key: the domain other loops subscribe to (e.g. "auth", "billing"). */ domain: string; kind: SignalKind; /** Free-form message for the consuming loop (what was found / what is blocked). */ payload: string; ts: string; /** Consumers that already saw this signal (poll dedupe). */ consumedBy: string[]; } /** * Materialize the append-only log: emit records become signals, consume records * fold into the matching signal's consumedBy[]. Unparseable lines are skipped * (the log is append-only — a torn last line must not poison the whole view). */ export declare function readSignals(): LoopSignal[]; export interface EmitParams { sourceLoop: string; domain: string; kind: SignalKind; payload: string; } export interface EmitResult { ok: boolean; signal?: LoopSignal; error?: string; } export declare function emitSignal(params: EmitParams): EmitResult; export interface PollParams { /** Who is polling — usually the consuming loop's id ("/"). */ consumer: string; /** Only signals of this domain (a loop polls the domains it listens to). */ domain?: string; /** Only signals whose sourceLoop belongs to this repo. */ repo?: string; /** Peek without marking the signals consumed (default: false — poll consumes). */ peek?: boolean; } export interface PollResult { ok: boolean; signals?: LoopSignal[]; error?: string; } /** * Fetch unconsumed signals for a consumer, oldest first. A signal is delivered * at most once per consumer: delivery appends a consume record, and signals * whose consumedBy[] already contains the consumer are skipped (dedupe). */ export declare function pollSignals(params: PollParams): PollResult;