/**
 * CanvasDocFetcher — DocFetcher adapter for Sanity Canvas.
 *
 * Ref resolution: tagged `canvas-doc` refs resolve by `documentId`, and —
 * a deliberate, documented divergence from the Drive adapter — untagged
 * id-refs (`{id: "…"}`) are accepted with `id` read as the canvas
 * document's `_id`. Canvas documents ARE Content Lake documents
 * (`_type: sanity.canvas.document`) whose `_id` is exactly what the ref
 * carries, and untagged id-refs are the only ref form the repo task-file
 * schema accepts today (adapter ref shapes are tracked under W0218 /
 * W0220) — rejecting them would leave repo-authored tasks with no way to
 * name a canvas doc. Slug / path / perspective refs have no Canvas meaning
 * and throw `RefKindMismatchError`.
 *
 * Ref-less tasks get the whole source corpus (`source.documentIds`) as
 * context — the Canvas analogue of Drive's whole-folder mode.
 *
 * Failure policy (Drive precedent): auth failures (401/403) abort the run
 * naming the environment, API host, and token env var — nothing else will
 * succeed; other per-document failures accumulate as fetch failures and
 * the run continues; all-documents-failed aborts. Whole-source failures
 * are recorded once (attributed to the first ref-less task that hit them);
 * explicit-ref failures stay per task so grading can tell "the model
 * ignored its docs" from "this task's docs were unreadable".
 *
 * The output-side plumbing (artifact writing, zero-symbol manifest,
 * override narrowing) intentionally parallels the Drive fetcher rather
 * than extracting shared modules — this PR stays additive to the canvas
 * directory; a cross-adapter extraction is offered as a follow-up.
 */
import { type DocFetcher, type DocSourceConfig, type FetchResult, type GeneralizedTaskDefinition } from "../../../_vendor/ailf-core/index.d.ts";
import { type CanvasClient } from "./canvas-client.js";
import type { CanvasSource } from "./types.js";
export declare class CanvasDocFetcher implements DocFetcher {
    private readonly source;
    private readonly client;
    private readonly documents;
    private readonly rootDir;
    constructor(source: CanvasSource, client: CanvasClient, options?: {
        rootDir?: string | null;
    });
    fetch(tasks: GeneralizedTaskDefinition[], source?: DocSourceConfig): Promise<FetchResult>;
    /**
     * Narrow a per-call source override, mirroring the Drive adapter: the
     * pipeline's fetch-docs step passes the kind-erased `ResolvedSourceConfig`
     * on every call, so an untagged override falls back to the constructor
     * source; a tagged foreign source signals a caller bypassing the registry
     * and is rejected loudly. Beyond the Drive semantics, canvas overrides
     * that change transport coordinates are also rejected: the HTTP client is
     * bound to the constructor source's host + token at preset construction,
     * so such an override would silently keep fetching through the old
     * transport while error messages name the new one. Corpus-only overrides
     * (documentIds) are honored.
     */
    private resolveSource;
    /** Fetch each document once per run, shared across tasks referencing it. */
    private loadDocument;
    /**
     * Emit the per-task canonical context files and the symbol-index
     * manifest under `<rootDir>/contexts/`. `document-manifest.json` and
     * `fetch-failures.json` are written by `fetch-docs-step.ts` from the
     * returned `FetchMetadata` (same path as the Drive/Sanity adapters).
     * `escapeNunjucks` runs once at the write seam so the `DocContext`
     * returned from `fetch()` stays clean markdown.
     */
    private writeArtifacts;
}
