/** * DocsAccessorImpl — concrete implementation of the DocsAccessor interface. * * Routes document reads/writes to the correct backing store based on kind: * * ADR-068 (DB Charter) write-ownership table: * ┌───────────────────────┬─────────────────────────────────────┐ * │ kind │ backing store │ * ├───────────────────────┼─────────────────────────────────────┤ * │ session-receipt │ llmtxt.db (llmtxt/sdk receipts) │ * │ transcript │ llmtxt.db (llmtxt/sdk sessions) │ * │ knowledge-graph-node │ llmtxt.db (llmtxt/graph tables) │ * ├───────────────────────┼─────────────────────────────────────┤ * │ adr │ manifest.db (CleoBlobStore blobs) │ * │ agent-output │ manifest.db (CleoBlobStore blobs) │ * │ attachment │ manifest.db (CleoBlobStore blobs) │ * └───────────────────────┴─────────────────────────────────────┘ * * llmtxt SDK is an implementation detail — consumers import DocsAccessor * from @cleocode/contracts, not from llmtxt/* subpaths. * * ADR-069 (Coordination Layers): This class is a Storage Layer component. * CLI commands instantiate it via createDocsAccessor() (exported from * @cleocode/core/internal) and pass it as a dependency — never call * llmtxt or CleoBlobStore directly in command handlers. * * NOTE on blob store usage: CleoBlobStore uses `(taskId, name)` addressing. * DocsAccessorImpl uses the sentinel taskId `__docs__` for doc-kind blobs * and the document title (or a generated slug) as the name. * * @task T9063 * @epic T9048 * @see ADR-068 — DB Charter (per-DB write ownership) * @see ADR-069 — Coordination Layers (Storage Layer boundary) * @see packages/contracts/src/docs-accessor.ts (interface) * @see packages/core/src/store/llmtxt-blob-adapter.ts (manifest.db backend) * @see packages/core/src/sessions/agent-session-adapter.ts (llmtxt.db backend) */ import type { DocExportFormat, DocRecord, DocSearchHit, DocsAccessor, ListDocsFilters, StoreDocParams, StoreDocResult } from '@cleocode/contracts'; /** * Options for constructing a {@link DocsAccessorImpl}. */ export interface DocsAccessorImplOptions { /** * Absolute path to the CLEO project root (the directory containing `.cleo/`). * Required for locating the manifest.db blob store. */ projectRoot: string; } /** * Concrete implementation of {@link DocsAccessor}. * * Wraps CleoBlobStore (manifest.db) for ADR / agent-output / attachment kinds * and an in-memory store for llmtxt.db-routed kinds pending T9064 integration. * * @see DocsAccessor (interface contract in @cleocode/contracts) */ export declare class DocsAccessorImpl implements DocsAccessor { /** CleoBlobStore for manifest.db-backed doc kinds. */ private blobStore; /** In-process store for llmtxt.db-routed kinds (pre-T9064). */ private llmtxtDocs; /** Track blob attachments stored via storeDoc by (hash → DocRecord shape). */ private blobIndex; constructor(options: DocsAccessorImplOptions); /** * Store a document, routing to manifest.db or llmtxt.db by kind. * * ADR-068: adr, agent-output, attachment → manifest.db (CleoBlobStore). * session-receipt, transcript, knowledge-graph-node → llmtxt.db. */ storeDoc(params: StoreDocParams): Promise; /** * Retrieve a document by ID or content hash. * * Searches in-memory llmtxt.db map first, then manifest.db (blob store). */ getDoc(idOrHash: string): Promise; /** * List documents matching filters with pagination support. * * Merges results from manifest.db (blob index) and in-memory llmtxt.db map. */ listDocs(filters?: ListDocsFilters): Promise; /** * Search documents by semantic similarity via llmtxt/similarity. * * Full embedding-based search requires llmtxt/similarity and T9064 * integration. Until then returns an empty result set rather than throwing. * * @param query - Natural language search query. * @param limit - Maximum results to return. */ searchDocs(_query: string, _limit?: number): Promise; /** * Export a document in the requested format. * * @param id - Document ID. * @param format - Output format. Default: 'markdown'. */ exportDoc(id: string, format?: DocExportFormat): Promise; /** * Release resources held by this accessor. */ close(): Promise; } /** * Create a DocsAccessor for the given project root. * * CLI command handlers call this factory instead of constructing * DocsAccessorImpl directly (ADR-069 Coordination Layers boundary). * * @param projectRoot - Absolute path to the CLEO project root. * @returns A fully initialized DocsAccessor. */ export declare function createDocsAccessor(projectRoot: string): DocsAccessor; //# sourceMappingURL=docs-accessor-impl.d.ts.map