import { KNOWLEDGE_FILE_CHAR_CAP, type KnowledgeReadResult } from "../shared/knowledge-read.js"; import type { NoteDocument, NoteFolder, NoteStoreResult, NoteSummary } from "../shared/types.js"; export type { NoteDocument, NoteFolder, NoteStoreResult, NoteSummary } from "../shared/types.js"; /** Notes are bounded so list/read and MCP calls cannot become context bombs. */ export declare const NOTE_FILE_MAX_BYTES = 2000000; export declare const NOTE_PREVIEW_CHAR_CAP = 180; export declare function listNotes(options?: { query?: string; home?: string; }): { notes: NoteSummary[]; folders: NoteFolder[]; }; export declare function readNote(notePath: string, home?: string): NoteStoreResult; export declare function createNote(input: { title: string; body?: string; folder?: string; }, home?: string): NoteStoreResult; export declare function updateNote(input: { path: string; expectedRevision: string; title?: string; body?: string; append?: string; }, home?: string): NoteStoreResult; /** Context-bomb guards: hit count, snippet chars, read chars, snippet word window. */ export declare const KNOWLEDGE_SEARCH_LIMIT = 20; export declare const KNOWLEDGE_SNIPPET_CHAR_CAP = 300; export { KNOWLEDGE_FILE_CHAR_CAP }; export interface KnowledgeSearchHit { /** Relative path, e.g. `knowledge/pricing-strategy.md` — feed to readKnowledgeFile. */ path: string; /** First markdown heading, else the filename. */ title: string; /** ~12-word window around the first match, matched token wrapped in «». */ snippet: string; /** Total occurrences of all query tokens across path + content. */ matchCount: number; } export type { KnowledgeReadResult } from "../shared/knowledge-read.js"; /** A file matches when EVERY query token appears in its relative path or content. * Results: `matchCount` desc, then path asc, capped at {@link KNOWLEDGE_SEARCH_LIMIT}. * Snippets only — never bodies. Symlinks and realpath escapes are skipped * entirely, so their content can't leak. */ export declare function searchKnowledge(query: string, home?: string): KnowledgeSearchHit[]; /** Read ONE file inside the active Jinn instance by relative path, starting at * `offset` chars in and returning at most {@link KNOWLEDGE_FILE_CHAR_CAP} of them. * SECURITY-CRITICAL: the path must be normalized and its realpath must resolve * inside the realpath of the instance root. Traversal, absolute paths, control * bytes, and symlink escapes are refused. `offset` is applied only after * containment, so it can never influence which file is resolved. */ export declare function readKnowledgeFile(relPath: string, home?: string, offset?: number): KnowledgeReadResult; //# sourceMappingURL=store.d.ts.map