import type { EnrichmentClient, Logger, RawSourceItem, SourceAdapter } from "@onenomad/przm-cortex-core"; import type { LLMRouter } from "@onenomad/przm-cortex-llm-core"; import type { Pipeline, PipelineContext } from "@onenomad/przm-cortex-pipeline-core"; import type { EngramClient } from "./clients/engram.js"; import type { LoadedTaxonomy } from "./taxonomy.js"; export interface SyncOptions { /** ISO 8601 — only fetch items changed after this. */ sinceIso?: string; /** Hard cap on items processed. 0 = unlimited. */ limit?: number; /** When true, run the fetch/transform/classify/pipeline pass but skip * the Engram write. Useful for `cortex sync --dry-run`. */ dryRun?: boolean; } export interface SyncResult { adapterId: string; fetched: number; transformed: number; classified: number; ingested: number; skipped: number; errors: number; } export interface PerItemResult { transformed: boolean; classified: boolean; ingested: number; skipped: number; error?: Error; } /** * Resolve the pipeline packages an adapter declared. Shared across sync, * stream, and webhook entry points so all three use the exact same * pipeline set per adapter. */ export declare function resolvePipelines(adapter: SourceAdapter): Pipeline[]; /** * Build a pipeline context bound to a specific logger + LLM router. Used * by every ingestion entry point so pipelines see the same shape regardless * of whether they were triggered by a cron run, a file-watcher event, or * an inbound webhook. */ export declare function buildPipelineContext(args: { logger: Logger; traceId: string; signal: AbortSignal; llmRouter?: LLMRouter; /** * Optional enrichment provider — used by pipelines when no local * LLM is configured. Implemented in production by a queue that an * MCP client (Pyre, Claude Desktop) drains via the Cortex * Enrichment Protocol tools. */ enrichment?: EnrichmentClient; /** * Active taxonomy. When provided, the pipeline context is enriched * with `selfAliases` + `peopleByAlias` so the signal extractor can * flag `mentions_me` and canonicalize owner references. */ taxonomy?: LoadedTaxonomy; }): PipelineContext; /** * Process one raw item end-to-end: transform → classify → each pipeline → * ingest (unless dryRun). Every ingestion path in Cortex funnels through * this so behavior stays identical across cron, stream, and webhook * entry points — the cost of fixing something in one place is paid once. */ export declare function processItem(args: { adapter: SourceAdapter; raw: RawSourceItem; pipelines: Pipeline[]; pipelineCtx: PipelineContext; engram: EngramClient; logger: Logger; dryRun?: boolean; }): Promise; /** * Run a single adapter's full ingestion cycle once. Called by the CLI * (`cortex sync `) and the scheduler. */ export declare function runSync(args: { adapter: SourceAdapter; engram: EngramClient; logger: Logger; /** Optional — pipelines that need LLM access require this. */ llmRouter?: LLMRouter; /** * Optional — Cortex Enrichment Protocol callback. Pipelines call * this when no local LLM is configured; the connected MCP client * (Pyre, Claude Desktop) drains the queue and answers. */ enrichment?: EnrichmentClient; /** Optional — pipelines that want mention/owner enrichment need this. */ taxonomy?: LoadedTaxonomy; opts?: SyncOptions; }): Promise; //# sourceMappingURL=sync.d.ts.map