import type { Logger, SourceAdapter } from "@onenomad/przm-cortex-core"; import type { LLMRouter } from "@onenomad/przm-cortex-llm-core"; import type { EngramClient } from "./clients/engram.js"; import type { HeartbeatWriter } from "./heartbeat.js"; export interface StreamWorker { /** Adapter id for logging / heartbeat. */ adapterId: string; /** Stop the worker and tear down the upstream iterator. */ stop(): Promise; /** Resolves when the underlying iterator has fully drained. */ done: Promise; } export interface StartStreamWorkersArgs { adapters: readonly SourceAdapter[]; engram: EngramClient; llmRouter?: LLMRouter; heartbeat?: HeartbeatWriter; logger: Logger; } /** * Start a long-running stream worker for every adapter that implements * `stream()`. Each worker consumes its adapter's async iterable, routes * items through the shared processItem helper, and loops until told to * stop or the iterator ends. * * Critically, adapters with a `fetch()`-based cron schedule can ALSO * implement `stream()` — the two paths are additive, not exclusive. That * matches reality: you want Obsidian's file watcher for "just saved" * events AND a periodic walk to pick up anything the watcher missed * (dropped fs events are common during editor saves). */ export declare function startStreamWorkers(args: StartStreamWorkersArgs): StreamWorker[]; //# sourceMappingURL=streams.d.ts.map