export declare const MEMORY_SCOPES: readonly ["node", "project", "profile", "user", "builtin"]; export type MemoryScopeName = typeof MEMORY_SCOPES[number]; /** A canonical document address: slash-joined safe segments, carried as one percent-encoded path segment. */ export declare function isMemoryDocName(name: string): boolean; export interface MemoryScope { node?: string; cwd?: string; profile?: string; store?: MemoryScopeName; } export interface MemoryDocSummaryDTO { name: string; short_form: string; kind: string; scope: MemoryScopeName; extensions: Record>; path: string; store_root: string; physical_relative_path: string; candidates?: MemoryCandidateDTO[]; } export interface MemoryCandidateDTO { winner: boolean; scope: MemoryScopeName; store_root: string; physical_relative_path: string; path: string; } export interface MemoryDocDTO extends MemoryDocSummaryDTO { body: string; frontmatter: Record | null; representation: 'leaf-file' | 'directory-index'; links: string[]; findings?: MemoryLintFindingDTO[]; } export interface MemoryLintFindingDTO { severity: string; rule: string; message: string; } export interface MemoryListQuery extends MemoryScope { kind?: string; limit?: number; after?: string; } export interface MemoryDocCreateRequest extends MemoryScope { name: string; kind: string; when_and_why_to_read: string; body: string; frontmatter?: Record; extensions?: Record>; } export interface MemoryDocUpdateRequest extends MemoryScope { rationale: string; body?: string; frontmatter?: Record; extensions?: Record>; unset?: string[]; } export interface MemoryDocDeletedDTO { name: string; scope: MemoryScopeName; path: string; log_path: string; deleted: true; } export interface MemoryDocMoveRequest extends MemoryScope { to: string; } export interface MemoryDocMovedDTO { name: string; previous_name: string; scope: MemoryScopeName; path: string; log_path: string; refs_rewritten: Array<{ name: string; scope: MemoryScopeName; path: string; refs: number; }>; follow_up: string; } export interface MemorySearchRequest extends MemoryScope { query: string; kind?: string; grep?: boolean; body?: boolean; limit?: number; after?: string; min_score?: number; } export type MemorySearchHitDTO = MemoryRankedSearchHitDTO | MemoryGrepSearchHitDTO; export interface MemoryRankedSearchHitDTO { name: string; kind: string; scope: MemoryScopeName; score: number; short_form: string; path: string; store_root: string; physical_relative_path: string; candidates?: MemoryCandidateDTO[]; } export interface MemoryGrepSearchHitDTO { name: string; scope: MemoryScopeName; line: number; text: string; path: string; store_root: string; physical_relative_path: string; candidates?: MemoryCandidateDTO[]; } export interface MemoryHistoryQuery extends MemoryScope { limit?: number; revision?: number; diff?: boolean; } export interface MemoryHistoryRevisionDTO { revision: number; op: 'create' | 'edit' | 'delete' | 'move'; at: string; node?: string; rationale?: string; verbatim?: true; body_changed: boolean; frontmatter_changed: string[]; diff?: string; } export interface MemoryHistoryRecordDTO { revision: number; op: 'create' | 'edit' | 'delete' | 'move'; at: string; node?: string; cwd: string; from?: string; rationale?: string; verbatim?: boolean; before: string; after: string; } export interface MemoryHistoryDTO { name: string; scope: MemoryScopeName; log_path: string; total: number; deleted?: unknown; revisions?: MemoryHistoryRevisionDTO[]; record?: MemoryHistoryRecordDTO; } export interface MemoryDocRefDTO { name: string; scope: string; path: string; store_root: string; physical_relative_path: string; plugin?: string; } export interface MemoryListDTO { object: 'list'; data: T[]; has_more: boolean; }