/** * PRI-468 — Plugin adapter implementing the core `IntentDocReader` port. * * Bridges the plugin-owned `safeReadIntentDoc()` I/O function to the * core-owned `IntentDocReader` interface so Stage A (in core) can read * INTENT.md without core performing any filesystem I/O. * * This adapter only MAPS types — it adds no new I/O, no new flag checks, * and no new telemetry. The underlying `safeReadIntentDoc()` already * performs the flag-first check (SPEC §12), TTL+mtime cache, and size cap. * * ERR checklist: * EP-01 / ERR-001: never `as` — field-by-field mapping with typeof checks * EP-02 / ERR-025: plugin I/O file, whitelisted in architecture-regression * EP-03 / ERR-002: every degraded path flows through with reason + nextAction * * Architecture: this file is I/O (delegates to fs-reading safeReadIntentDoc). * It will be added to KNOWN_PLUGIN_CORE_FILES in architecture-regression.test.ts. */ import type { IntentDocReader, IntentLang } from '@principles/core/runtime-v2'; /** * Detect which language's INTENT file exists on disk. * Priority: zh-CN first, then en. Defaults to zh-CN if neither exists. * * This lets hooks avoid hardcoding a single language — the Owner may have * created either INTENT.zh-CN.md or INTENT.en.md. */ export declare function resolveIntentLang(workspaceDir: string): IntentLang; /** * Create an IntentDocReader bound to a specific workspace and language. * * The returned reader is stateless beyond the (workspace, lang) binding — each * `readIntentDoc()` call delegates to `safeReadIntentDoc()`, which owns * the TTL+mtime cache keyed by `${workspaceDir}:${lang}`. */ export declare function createIntentDocReader(workspaceDir: string, lang: IntentLang): IntentDocReader;